STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.

Make default_noexcept.pass.cpp tests more portable.

They were static_asserting that the following things are 
nothrow-default-constructible:

ordered/unordered associative containers
container adaptors
deque
forward_list
list
vector<bool>

The Standard doesn't mark these things as having noexcept default constructors, 
so the static_asserts should be marked as libc++ specific.

http://reviews.llvm.org/D21715

Files:
  test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
  
test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
  
test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
  test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp
  
test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
  
test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
  
test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
  test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
  
test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
  test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
  test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
  test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp
  
test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp
  
test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp
  test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp

Index: test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp
+++ test/std/containers/unord/unord.set/unord.set.cnstr/default_noexcept.pass.cpp
@@ -47,12 +47,12 @@
 {
     {
         typedef std::unordered_set<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
                            std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::unordered_set<MoveOnly, std::hash<MoveOnly>,
Index: test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp
+++ test/std/containers/unord/unord.multiset/unord.multiset.cnstr/default_noexcept.pass.cpp
@@ -47,12 +47,12 @@
 {
     {
         typedef std::unordered_multiset<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
                            std::equal_to<MoveOnly>, test_allocator<MoveOnly>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::unordered_multiset<MoveOnly, std::hash<MoveOnly>,
Index: test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp
+++ test/std/containers/unord/unord.multimap/unord.multimap.cnstr/default_noexcept.pass.cpp
@@ -47,12 +47,12 @@
 {
     {
         typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
                            std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::unordered_multimap<MoveOnly, MoveOnly, std::hash<MoveOnly>,
Index: test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp
+++ test/std/containers/unord/unord.map/unord.map.cnstr/default_noexcept.pass.cpp
@@ -47,12 +47,12 @@
 {
     {
         typedef std::unordered_map<MoveOnly, MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
                            std::equal_to<MoveOnly>, test_allocator<std::pair<const MoveOnly, MoveOnly>>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::unordered_map<MoveOnly, MoveOnly, std::hash<MoveOnly>,
Index: test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
+++ test/std/containers/sequences/vector.bool/default_noexcept.pass.cpp
@@ -32,11 +32,11 @@
 {
     {
         typedef std::vector<bool> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::vector<bool, test_allocator<bool>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::vector<bool, other_allocator<bool>> C;
Index: test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
+++ test/std/containers/sequences/list/list.cons/default_noexcept.pass.cpp
@@ -33,11 +33,11 @@
 {
     {
         typedef std::list<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::list<MoveOnly, test_allocator<MoveOnly>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::list<MoveOnly, other_allocator<MoveOnly>> C;
Index: test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
+++ test/std/containers/sequences/forwardlist/forwardlist.cons/default_noexcept.pass.cpp
@@ -33,11 +33,11 @@
 {
     {
         typedef std::forward_list<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::forward_list<MoveOnly, test_allocator<MoveOnly>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::forward_list<MoveOnly, other_allocator<MoveOnly>> C;
Index: test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
+++ test/std/containers/sequences/deque/deque.cons/default_noexcept.pass.cpp
@@ -33,11 +33,11 @@
 {
     {
         typedef std::deque<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::deque<MoveOnly, test_allocator<MoveOnly>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::deque<MoveOnly, other_allocator<MoveOnly>> C;
Index: test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
+++ test/std/containers/container.adaptors/stack/stack.cons/default_noexcept.pass.cpp
@@ -25,6 +25,6 @@
 {
     {
         typedef std::stack<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
 }
Index: test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
+++ test/std/containers/container.adaptors/queue/queue.cons/default_noexcept.pass.cpp
@@ -25,6 +25,6 @@
 {
     {
         typedef std::queue<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
 }
Index: test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
+++ test/std/containers/container.adaptors/priority.queue/priqueue.cons/default_noexcept.pass.cpp
@@ -26,6 +26,6 @@
 {
     {
         typedef std::priority_queue<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
 }
Index: test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp
+++ test/std/containers/associative/set/set.cons/default_noexcept.pass.cpp
@@ -37,11 +37,11 @@
 {
     {
         typedef std::set<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::set<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::set<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
Index: test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
+++ test/std/containers/associative/multiset/multiset.cons/default_noexcept.pass.cpp
@@ -37,11 +37,11 @@
 {
     {
         typedef std::multiset<MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::multiset<MoveOnly, std::less<MoveOnly>, test_allocator<MoveOnly>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::multiset<MoveOnly, std::less<MoveOnly>, other_allocator<MoveOnly>> C;
Index: test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
+++ test/std/containers/associative/multimap/multimap.cons/default_noexcept.pass.cpp
@@ -38,11 +38,11 @@
     typedef std::pair<const MoveOnly, MoveOnly> V;
     {
         typedef std::multimap<MoveOnly, MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::multimap<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
Index: test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
===================================================================
--- test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
+++ test/std/containers/associative/map/map.cons/default_noexcept.pass.cpp
@@ -38,11 +38,11 @@
     typedef std::pair<const MoveOnly, MoveOnly> V;
     {
         typedef std::map<MoveOnly, MoveOnly> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, test_allocator<V>> C;
-        static_assert(std::is_nothrow_default_constructible<C>::value, "");
+        LIBCPP_STATIC_ASSERT(std::is_nothrow_default_constructible<C>::value, "");
     }
     {
         typedef std::map<MoveOnly, MoveOnly, std::less<MoveOnly>, other_allocator<V>> C;
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to