File tree Expand file tree Collapse file tree 2 files changed +13
-19
lines changed
test/std/utilities/meta/meta.unary/meta.unary.prop Expand file tree Collapse file tree 2 files changed +13
-19
lines changed Original file line number Diff line number Diff line change 1212#include < __config>
1313#include < __type_traits/integral_constant.h>
1414#include < __type_traits/is_destructible.h>
15- #include < __type_traits/is_reference.h>
16- #include < __type_traits/is_scalar.h>
17- #include < __type_traits/remove_all_extents.h>
1815#include < __utility/declval.h>
1916#include < cstddef>
2017
2421
2522_LIBCPP_BEGIN_NAMESPACE_STD
2623
27- #if !defined(_LIBCPP_CXX03_LANG)
24+ #if __has_builtin(__is_nothrow_destructible)
25+
26+ template <class _Tp >
27+ struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible : integral_constant<bool , __is_nothrow_destructible(_Tp)> {};
28+
29+ #else
2830
2931template <bool , class _Tp >
3032struct __libcpp_is_nothrow_destructible ;
@@ -49,20 +51,7 @@ struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&> : public true_type {};
4951template <class _Tp >
5052struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp&&> : public true_type {};
5153
52- #else
53-
54- template <class _Tp >
55- struct __libcpp_nothrow_destructor : public integral_constant <bool , is_scalar<_Tp>::value || is_reference<_Tp>::value> {
56- };
57-
58- template <class _Tp >
59- struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible : public __libcpp_nothrow_destructor<__remove_all_extents_t <_Tp> > {
60- };
61-
62- template <class _Tp >
63- struct _LIBCPP_TEMPLATE_VIS is_nothrow_destructible<_Tp[]> : public false_type {};
64-
65- #endif
54+ #endif // __has_builtin(__is_nothrow_destructible)
6655
6756#if _LIBCPP_STD_VER >= 17
6857template <class _Tp >
Original file line number Diff line number Diff line change @@ -56,6 +56,10 @@ struct PurePublicDestructor { public: virtual ~PurePublicDestruc
5656struct PureProtectedDestructor { protected: virtual ~PureProtectedDestructor () = 0 ; };
5757struct PurePrivateDestructor { private: virtual ~PurePrivateDestructor () = 0 ; };
5858
59+ struct ExplicitlyNoThrowDestructor {
60+ ~ExplicitlyNoThrowDestructor () TEST_NOEXCEPT {}
61+ };
62+
5963class Empty
6064{
6165};
@@ -92,11 +96,12 @@ int main(int, char**)
9296 test_is_nothrow_destructible<PublicDestructor>();
9397 test_is_nothrow_destructible<VirtualPublicDestructor>();
9498 test_is_nothrow_destructible<PurePublicDestructor>();
99+ #endif
100+ test_is_nothrow_destructible<ExplicitlyNoThrowDestructor>();
95101 test_is_nothrow_destructible<bit_zero>();
96102 test_is_nothrow_destructible<Abstract>();
97103 test_is_nothrow_destructible<Empty>();
98104 test_is_nothrow_destructible<Union>();
99- #endif
100105 // requires access control
101106 test_is_not_nothrow_destructible<ProtectedDestructor>();
102107 test_is_not_nothrow_destructible<PrivateDestructor>();
You can’t perform that action at this time.
0 commit comments