summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2010-09-08 16:39:18 +0000
committerHoward Hinnant <hhinnant@apple.com>2010-09-08 16:39:18 +0000
commit1be27f0929e70f1816aa0561c84f3b823fceb439 (patch)
treebf6c77349e48b99d27206dfb454f34ab17240dfb
parent928d8294c2e0db5f217f4d13489429fc8bae8bfd (diff)
downloadbcm5719-llvm-1be27f0929e70f1816aa0561c84f3b823fceb439.tar.gz
bcm5719-llvm-1be27f0929e70f1816aa0561c84f3b823fceb439.zip
has_nothrow_copy_assign hooked up to clang
llvm-svn: 113364
-rw-r--r--libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp48
1 files changed, 18 insertions, 30 deletions
diff --git a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp
index 127e76290e0..c46900ba4a9 100644
--- a/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp
+++ b/libcxx/test/utilities/meta/meta.unary/meta.unary.prop/has_nothrow_copy_assign.pass.cpp
@@ -13,29 +13,17 @@
#include <type_traits>
-template <class T>
+template <class T, bool Result>
void test_has_nothrow_assign()
{
- static_assert( std::has_nothrow_copy_assign<T>::value, "");
- static_assert(!std::has_nothrow_copy_assign<const T>::value, "");
- static_assert( std::has_nothrow_copy_assign<volatile T>::value, "");
- static_assert(!std::has_nothrow_copy_assign<const volatile T>::value, "");
-}
-
-template <class T>
-void test_has_not_nothrow_assign()
-{
- static_assert(!std::has_nothrow_copy_assign<T>::value, "");
- static_assert(!std::has_nothrow_copy_assign<const T>::value, "");
- static_assert(!std::has_nothrow_copy_assign<volatile T>::value, "");
- static_assert(!std::has_nothrow_copy_assign<const volatile T>::value, "");
+ static_assert(std::has_nothrow_copy_assign<T>::value == Result, "");
}
class Empty
{
};
-class NotEmpty
+struct NotEmpty
{
virtual ~NotEmpty();
};
@@ -47,7 +35,7 @@ struct bit_zero
int : 0;
};
-class Abstract
+struct Abstract
{
virtual ~Abstract() = 0;
};
@@ -59,19 +47,19 @@ struct A
int main()
{
- test_has_not_nothrow_assign<void>();
- test_has_not_nothrow_assign<A>();
- test_has_not_nothrow_assign<int&>();
+ test_has_nothrow_assign<void, false>();
+ test_has_nothrow_assign<A, false>();
+ test_has_nothrow_assign<int&, false>();
+ test_has_nothrow_assign<Abstract, false>();
+ test_has_nothrow_assign<char[3], false>();
+ test_has_nothrow_assign<char[], false>();
- test_has_nothrow_assign<Union>();
- test_has_nothrow_assign<Abstract>();
- test_has_nothrow_assign<Empty>();
- test_has_nothrow_assign<int>();
- test_has_nothrow_assign<double>();
- test_has_nothrow_assign<int*>();
- test_has_nothrow_assign<const int*>();
- test_has_nothrow_assign<char[3]>();
- test_has_nothrow_assign<char[3]>();
- test_has_nothrow_assign<NotEmpty>();
- test_has_nothrow_assign<bit_zero>();
+ test_has_nothrow_assign<Union, true>();
+ test_has_nothrow_assign<Empty, true>();
+ test_has_nothrow_assign<int, true>();
+ test_has_nothrow_assign<double, true>();
+ test_has_nothrow_assign<int*, true>();
+ test_has_nothrow_assign<const int*, true>();
+ test_has_nothrow_assign<NotEmpty, true>();
+ test_has_nothrow_assign<bit_zero, true>();
}
OpenPOWER on IntegriCloud