Index: include/type_traits =================================================================== --- include/type_traits +++ include/type_traits @@ -3675,9 +3675,14 @@ // is_trivially_destructible -#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403) +#if __has_keyword(__is_trivially_destructible) template struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible + : public integral_constant {}; + +#elif __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403) + +template struct _LIBCPP_TEMPLATE_VIS is_trivially_destructible : public integral_constant::value && __has_trivial_destructor(_Tp)> {}; #else @@ -3702,19 +3707,16 @@ // is_nothrow_constructible -#if 0 +#ifndef _LIBCPP_HAS_NO_VARIADICS + +#if __has_keyword(__is_nothrow_constructible) + template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible - : public integral_constant -{ -}; + : public integral_constant {}; -#else +#elif __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) -#ifndef _LIBCPP_HAS_NO_VARIADICS - -#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) - template struct __libcpp_is_nothrow_constructible; template @@ -3750,7 +3752,7 @@ { }; -#else // __has_feature(cxx_noexcept) +#else // __has_keyword(__is_nothrow_constructible) || __has_feature(cxx_noexcept) template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible @@ -3806,9 +3808,26 @@ #else // _LIBCPP_HAS_NO_VARIADICS +#if __has_keyword(__is_nothrow_constructible) + template struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible + : public integral_constant {}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp, _A0> + : public integral_constant {}; + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible<_Tp> + : public integral_constant {}; + +#else // __has_keyword(__is_nothrow_constructible) + +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible : false_type { }; @@ -3857,8 +3876,8 @@ { }; +#endif // __has_keyword(__is_nothrow_constructible) #endif // _LIBCPP_HAS_NO_VARIADICS -#endif // __has_feature(is_nothrow_constructible) #if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS) template @@ -3908,8 +3927,14 @@ // is_nothrow_assignable -#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) +#if __has_keyword(__is_nothrow_assignable) +template +struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable + : public integral_constant {}; + +#elif __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) + template struct __libcpp_is_nothrow_assignable; template @@ -3930,7 +3955,7 @@ { }; -#else // __has_feature(cxx_noexcept) +#else // __has_keyword(__is_nothrow_assignable) || __has_feature(cxx_noexcept) template struct _LIBCPP_TEMPLATE_VIS is_nothrow_assignable Index: test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp =================================================================== --- test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp +++ test/std/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp @@ -116,4 +116,12 @@ test_is_not_trivially_destructible(); test_is_not_trivially_destructible(); #endif + +#if defined(__is_identifier) +#if !__is_identifier(_Atomic) + test_is_trivially_destructible<_Atomic int>(); + test_is_trivially_destructible<_Atomic float>(); + test_is_trivially_destructible<_Atomic int*>(); +#endif +#endif }