summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libcxx/include/type_traits21
-rw-r--r--libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp7
2 files changed, 10 insertions, 18 deletions
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits
index 14ed698dfbd..0d578bbe0bd 100644
--- a/libcxx/include/type_traits
+++ b/libcxx/include/type_traits
@@ -2036,26 +2036,15 @@ template<typename, typename _Tp> struct __select_2nd { typedef _Tp type; };
template <class _Tp, class _Arg>
typename __select_2nd<decltype((_VSTD::declval<_Tp>() = _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 <class, class>
+false_type __is_assignable_test(...);
-template <class _Arg>
-false_type
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
-__is_assignable_test(__any, _Arg&&);
-#else
-__is_assignable_test(__any, _Arg&);
-#endif
template <class _Tp, class _Arg, bool = is_void<_Tp>::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 <class _Tp, class _Arg>
struct __is_assignable_imp<_Tp, _Arg, true>
diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
index b734a1aa60d..f4736e71342 100644
--- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_assignable.pass.cpp
+++ b/libcxx/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 <class U>
@@ -59,6 +59,8 @@ struct E
template <typename T>
struct X { T t; };
+struct Incomplete;
+
int main()
{
test_is_assignable<int&, int&> ();
@@ -67,7 +69,7 @@ int main()
test_is_assignable<B, A> ();
test_is_assignable<void*&, void*> ();
-#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
+#if TEST_STD_VER >= 11
test_is_assignable<E, int> ();
test_is_not_assignable<int, int&> ();
@@ -80,4 +82,5 @@ int main()
// pointer to incomplete template type
test_is_assignable<X<D>*&, X<D>*> ();
+ test_is_not_assignable<Incomplete&, Incomplete const&>();
}
OpenPOWER on IntegriCloud