diff options
4 files changed, 6 insertions, 153 deletions
diff --git a/libcxx/include/type_traits b/libcxx/include/type_traits index 67c91776a74..816120290bf 100644 --- a/libcxx/include/type_traits +++ b/libcxx/include/type_traits @@ -2198,12 +2198,8 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_copy_assignable_v // is_move_assignable template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_move_assignable -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES : public is_assignable<typename add_lvalue_reference<_Tp>::type, typename add_rvalue_reference<_Tp>::type> {}; -#else - : public is_copy_assignable<_Tp> {}; -#endif #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) template <class _Tp> @@ -2304,8 +2300,6 @@ forward(typename remove_reference<_Tp>::type&& __t) _NOEXCEPT return static_cast<_Tp&&>(__t); } -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _Tp> inline _LIBCPP_INLINE_VISIBILITY typename decay<_Tp>::type @@ -2314,18 +2308,6 @@ __decay_copy(_Tp&& __t) return _VSTD::forward<_Tp>(__t); } -#else - -template <class _Tp> -inline _LIBCPP_INLINE_VISIBILITY -typename decay<_Tp>::type -__decay_copy(const _Tp& __t) -{ - return _VSTD::forward<_Tp>(__t); -} - -#endif - template <class _Rp, class _Class, class ..._Param> struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> { @@ -2872,11 +2854,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_copy_constructible_v template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_move_constructible -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> -#else - : public is_copy_constructible<_Tp> -#endif {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) @@ -2914,11 +2892,7 @@ struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp> }; template <class _Tp> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp&&> -#else -struct _LIBCPP_TEMPLATE_VIS is_trivially_constructible<_Tp, _Tp> -#endif : integral_constant<bool, is_scalar<_Tp>::value> { }; @@ -2971,11 +2945,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copy_constructible_v // is_trivially_move_constructible template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_constructible -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> -#else - : public is_trivially_copy_constructible<_Tp> -#endif {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) @@ -3012,14 +2982,10 @@ template <class _Tp> struct is_trivially_assignable<_Tp&, const _Tp&> : integral_constant<bool, is_scalar<_Tp>::value> {}; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _Tp> struct is_trivially_assignable<_Tp&, _Tp&&> : integral_constant<bool, is_scalar<_Tp>::value> {}; -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - #endif // !__has_feature(is_trivially_assignable) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) @@ -3044,11 +3010,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_trivially_copy_assignable_v template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_trivially_move_assignable : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type, -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES typename add_rvalue_reference<_Tp>::type> -#else - typename add_lvalue_reference<_Tp>::type> -#endif {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) @@ -3097,7 +3059,7 @@ template <class _Tp, class... _Args> struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible : public integral_constant<bool, __is_nothrow_constructible(_Tp, _Args...)> {}; -#elif !defined(_LIBCPP_HAS_NO_NOEXCEPT) +#else template <bool, bool, class _Tp, class... _Args> struct __libcpp_is_nothrow_constructible; @@ -3134,58 +3096,6 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp[_Ns]> { }; -#else // __has_keyword(__is_nothrow_constructible) || !defined(_LIBCPP_HAS_NO_NOEXCEPT) - -template <class _Tp, class... _Args> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible - : false_type -{ -}; - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp> -#if __has_feature(has_nothrow_constructor) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant<bool, __has_nothrow_constructor(_Tp)> -#else - : integral_constant<bool, is_scalar<_Tp>::value> -#endif -{ -}; - -template <class _Tp> -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&&> -#else -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp> -#endif -#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant<bool, __has_nothrow_copy(_Tp)> -#else - : integral_constant<bool, is_scalar<_Tp>::value> -#endif -{ -}; - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, const _Tp&> -#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant<bool, __has_nothrow_copy(_Tp)> -#else - : integral_constant<bool, is_scalar<_Tp>::value> -#endif -{ -}; - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _Tp&> -#if __has_feature(has_nothrow_copy) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant<bool, __has_nothrow_copy(_Tp)> -#else - : integral_constant<bool, is_scalar<_Tp>::value> -#endif -{ -}; - #endif // _LIBCPP_HAS_NO_NOEXCEPT @@ -3222,11 +3132,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_copy_constructible_v // is_nothrow_move_constructible template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_constructible -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> -#else - : public is_nothrow_copy_constructible<_Tp> -#endif {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) @@ -3243,7 +3149,7 @@ template <class _Tp, class _Arg> struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable : public integral_constant<bool, __is_nothrow_assignable(_Tp, _Arg)> {}; -#elif !defined(_LIBCPP_HAS_NO_NOEXCEPT) +#else template <bool, class _Tp, class _Arg> struct __libcpp_is_nothrow_assignable; @@ -3265,48 +3171,6 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable { }; -#else // __has_keyword(__is_nothrow_assignable) || !defined(_LIBCPP_HAS_NO_NOEXCEPT) - -template <class _Tp, class _Arg> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable - : public false_type {}; - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, _Tp> -#if __has_feature(has_nothrow_assign) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; -#else - : integral_constant<bool, is_scalar<_Tp>::value> {}; -#endif - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, _Tp&> -#if __has_feature(has_nothrow_assign) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; -#else - : integral_constant<bool, is_scalar<_Tp>::value> {}; -#endif - -template <class _Tp> -struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable<_Tp&, const _Tp&> -#if __has_feature(has_nothrow_assign) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; -#else - : integral_constant<bool, is_scalar<_Tp>::value> {}; -#endif - -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - -template <class _Tp> -struct is_nothrow_assignable<_Tp&, _Tp&&> -#if __has_feature(has_nothrow_assign) || defined(_LIBCPP_COMPILER_GCC) - : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; -#else - : integral_constant<bool, is_scalar<_Tp>::value> {}; -#endif - -#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES - #endif // _LIBCPP_HAS_NO_NOEXCEPT #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) @@ -3331,11 +3195,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_copy_assignable_v template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_move_assignable : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type, -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES typename add_rvalue_reference<_Tp>::type> -#else - typename add_lvalue_reference<_Tp>::type> -#endif {}; #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) @@ -3346,7 +3206,7 @@ _LIBCPP_INLINE_VAR _LIBCPP_CONSTEXPR bool is_nothrow_move_assignable_v // is_nothrow_destructible -#if !defined(_LIBCPP_HAS_NO_NOEXCEPT) +#if !defined(_LIBCPP_CXX03_LANG) template <bool, class _Tp> struct __libcpp_is_nothrow_destructible; @@ -3380,16 +3240,12 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&> { }; -#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES - template <class _Tp> struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&> : public true_type { }; -#endif - #else template <class _Tp> struct __libcpp_nothrow_destructor diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp index 5a330c6d34b..170990f4e34 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_assignable.pass.cpp @@ -62,11 +62,10 @@ int main(int, char**) test_is_move_assignable<NotEmpty> (); test_is_move_assignable<Empty> (); -#if TEST_STD_VER >= 11 test_is_not_move_assignable<const int> (); test_is_not_move_assignable<int[]> (); test_is_not_move_assignable<int[3]> (); -#endif + test_is_not_move_assignable<void> (); return 0; diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp index 06ca5c4630c..2ebafb102b8 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_move_constructible.pass.cpp @@ -61,9 +61,7 @@ struct A struct B { -#if TEST_STD_VER >= 11 B(B&&); -#endif }; int main(int, char**) diff --git a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp index 817d696d11f..853f32f80fe 100644 --- a/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp +++ b/libcxx/test/std/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp @@ -101,7 +101,7 @@ int main(int, char**) test_is_nothrow_destructible<Abstract>(); test_is_nothrow_destructible<Empty>(); test_is_nothrow_destructible<Union>(); - +#endif // requires access control test_is_not_nothrow_destructible<ProtectedDestructor>(); test_is_not_nothrow_destructible<PrivateDestructor>(); @@ -109,7 +109,7 @@ int main(int, char**) test_is_not_nothrow_destructible<VirtualPrivateDestructor>(); test_is_not_nothrow_destructible<PureProtectedDestructor>(); test_is_not_nothrow_destructible<PurePrivateDestructor>(); -#endif + return 0; } |