Hi mclow.lists, danalbert,

There are a couple of changes in this patch:

1. Fix is_nothrow_destructible<int[]> in C++03 mode to be false.
2. Wrap access control tests in #ifdef block
3. Wrap deleted function tests in #ifdef block.
4. Make the destructor public for the Abstract and AbstractDestructor types.

http://reviews.llvm.org/D6316

Files:
  include/type_traits
  test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
  
test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp
  
test/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp
Index: include/type_traits
===================================================================
--- include/type_traits
+++ include/type_traits
@@ -3208,6 +3208,8 @@
 template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible
     : public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
 
+template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp[]>
+    : public integral_constant<bool, false> {};
 #endif
 
 // is_pod
Index: test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
===================================================================
--- test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
+++ test/utilities/meta/meta.unary/meta.unary.prop/is_destructible.pass.cpp
@@ -68,14 +68,15 @@
 struct PureProtectedDestructor           { protected: virtual ~PureProtectedDestructor() = 0; };
 struct PurePrivateDestructor             { private:   virtual ~PurePrivateDestructor() = 0; };
 
+#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
 struct DeletedPublicDestructor           { public:    ~DeletedPublicDestructor() = delete; };
 struct DeletedProtectedDestructor        { protected: ~DeletedProtectedDestructor() = delete; };
 struct DeletedPrivateDestructor          { private:   ~DeletedPrivateDestructor() = delete; };
 
 struct DeletedVirtualPublicDestructor    { public:    virtual ~DeletedVirtualPublicDestructor() = delete; };
 struct DeletedVirtualProtectedDestructor { protected: virtual ~DeletedVirtualProtectedDestructor() = delete; };
 struct DeletedVirtualPrivateDestructor   { private:   virtual ~DeletedVirtualPrivateDestructor() = delete; };
-
+#endif
 
 int main()
 {
@@ -100,20 +101,23 @@
     test_is_not_destructible<int[]>();
     test_is_not_destructible<void>();
 
+#if __has_feature(cxx_access_control_sfinae)
     test_is_not_destructible<ProtectedDestructor>();
     test_is_not_destructible<PrivateDestructor>();
     test_is_not_destructible<VirtualProtectedDestructor>();
     test_is_not_destructible<VirtualPrivateDestructor>();
     test_is_not_destructible<PureProtectedDestructor>();
     test_is_not_destructible<PurePrivateDestructor>();
+#endif
+#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS
     test_is_not_destructible<DeletedPublicDestructor>();
     test_is_not_destructible<DeletedProtectedDestructor>();
     test_is_not_destructible<DeletedPrivateDestructor>();
 
 //     test_is_not_destructible<DeletedVirtualPublicDestructor>(); // currently fails due to clang bug #20268
     test_is_not_destructible<DeletedVirtualProtectedDestructor>();
     test_is_not_destructible<DeletedVirtualPrivateDestructor>();
-
+#endif
 #if __has_feature(cxx_access_control_sfinae) 
     test_is_not_destructible<NotEmpty>();
 #endif
Index: test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp
===================================================================
--- test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp
+++ test/utilities/meta/meta.unary/meta.unary.prop/is_nothrow_destructible.pass.cpp
@@ -49,11 +49,13 @@
 
 class Abstract
 {
+public:
     virtual void foo() = 0;
 };
 
 class AbstractDestructor
 {
+public:
     virtual ~AbstractDestructor() = 0;
 };
 
@@ -65,9 +67,9 @@
 int main()
 {
     test_is_not_nothrow_destructible<void>();
-    test_is_not_nothrow_destructible<AbstractDestructor>();
     test_is_not_nothrow_destructible<NotEmpty>();
     test_is_not_nothrow_destructible<char[]>();
+    test_is_not_nothrow_destructible<char[][3]>();
 
 #if __has_feature(cxx_noexcept)
     test_is_nothrow_destructible<A>();
@@ -84,7 +86,10 @@
     test_is_nothrow_destructible<int*>();
     test_is_nothrow_destructible<const int*>();
     test_is_nothrow_destructible<char[3]>();
+#if __has_feature(cxx_noexcept)
     test_is_nothrow_destructible<Abstract>();
+    test_is_nothrow_destructible<AbstractDestructor>();
+#endif
 #if __has_feature(cxx_noexcept)
     test_is_nothrow_destructible<bit_zero>();
 #endif
Index: test/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp
===================================================================
--- test/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp
+++ test/utilities/meta/meta.unary/meta.unary.prop/is_trivially_destructible.pass.cpp
@@ -37,6 +37,7 @@
 
 class NotEmpty
 {
+public:
     virtual ~NotEmpty();
 };
 
@@ -49,11 +50,13 @@
 
 class Abstract
 {
+public:
     virtual void foo() = 0;
 };
 
 class AbstractDestructor
 {
+public:
     virtual ~AbstractDestructor() = 0;
 };
 
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to