Index: include/type_traits =================================================================== --- include/type_traits +++ include/type_traits @@ -1294,17 +1294,20 @@ namespace __is_convertible_imp { -template void __test_convert(_Tp); +template +struct _Dst +{ + _Dst(_To); +}; -template -struct __is_convertible_test : public false_type {}; +template struct __one { typedef char type; }; +template typename __one(declval<_From>()))>::type __test(int); +template __two __test(...); template -struct __is_convertible_test<_From, _To, - decltype(__test_convert<_To>(_VSTD::declval<_From>()))> : public true_type -{}; +struct __is_convertible_test + : public integral_constant(0)) == 1> {}; -template __two __test(...); #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES template _Tp&& __source(); #else Index: test/std/utilities/meta/meta.rel/is_convertible.pass.cpp =================================================================== --- test/std/utilities/meta/meta.rel/is_convertible.pass.cpp +++ test/std/utilities/meta/meta.rel/is_convertible.pass.cpp @@ -52,6 +52,12 @@ NonCopyable(NonCopyable&); }; +class ForwardClass; +template class ForwardWrapper { + const T value; +}; +typedef ForwardWrapper Forward; + int main() { // void @@ -200,10 +206,11 @@ static_assert((std::is_convertible::value), ""); static_assert((std::is_convertible::value), ""); static_assert((!std::is_convertible::value), ""); -// This test requires Access control SFINAE which we only have in C++11 or when -// we are using the compiler builtin for is_convertible. -#if __cplusplus >= 201103L || !defined(_LIBCPP_USE_IS_CONVERTIBLE_FALLBACK) +// This test requires Access control SFINAE which we only have in C++11 +#if __cplusplus >= 201103L test_is_not_convertible(); #endif + // Forward + static_assert((std::is_convertible::value), ""); }