diff --git a/include/type_traits b/include/type_traits index 14ed698df..0d578bbe0 100644 --- a/include/type_traits +++ b/include/type_traits @@ -2036,26 +2036,15 @@ template struct __select_2nd { typedef _Tp type; }; template typename __select_2nd() = _VSTD::declval<_Arg>())), true_type>::type -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -__is_assignable_test(_Tp&&, _Arg&&); -#else -__is_assignable_test(_Tp, _Arg&); -#endif +__is_assignable_test(int); + +template +false_type __is_assignable_test(...); -template -false_type -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -__is_assignable_test(__any, _Arg&&); -#else -__is_assignable_test(__any, _Arg&); -#endif template ::value || is_void<_Arg>::value> struct __is_assignable_imp - : public common_type - < - decltype(_VSTD::__is_assignable_test(declval<_Tp>(), declval<_Arg>())) - >::type {}; + : public decltype((_VSTD::__is_assignable_test<_Tp, _Arg>(0))) {}; template struct __is_assignable_imp<_Tp, _Arg, true> diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp index b734a1aa6..f4736e713 100644 --- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp +++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp @@ -43,7 +43,7 @@ void test_is_not_assignable() struct D; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 struct C { template @@ -59,6 +59,8 @@ struct E template struct X { T t; }; +struct Incomplete; + int main() { test_is_assignable (); @@ -67,7 +69,7 @@ int main() test_is_assignable (); test_is_assignable (); -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES +#if TEST_STD_VER >= 11 test_is_assignable (); test_is_not_assignable (); @@ -80,4 +82,5 @@ int main() // pointer to incomplete template type test_is_assignable*&, X*> (); + test_is_not_assignable(); }