[libcxx] r267085 - Complete LWG issue #2016. Allocators must be nothrow swappable

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 21 17:15:20 PDT 2016


Author: ericwf
Date: Thu Apr 21 19:15:18 2016
New Revision: 267085

URL: http://llvm.org/viewvc/llvm-project?rev=267085&view=rev
Log:
Complete LWG issue #2016. Allocators must be nothrow swappable

Modified:
    libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp
    libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp
    libcxx/trunk/www/cxx1z_status.html

Modified: libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/map/map.special/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <map>
 
 // void swap(map& c)
@@ -22,6 +24,7 @@
 #include <map>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -93,7 +96,6 @@ struct some_alloc3
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     typedef std::pair<const MoveOnly, MoveOnly> V;
     {
         typedef std::map<MoveOnly, MoveOnly> C;
@@ -145,5 +147,4 @@ int main()
     }
 #endif
 
-#endif
 }

Modified: libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multimap/multimap.special/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <map>
 
 // void swap(multimap& c)
@@ -22,6 +24,7 @@
 #include <map>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -93,7 +96,6 @@ struct some_alloc3
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     typedef std::pair<const MoveOnly, MoveOnly> V;
     {
         typedef std::multimap<MoveOnly, MoveOnly> C;
@@ -144,6 +146,4 @@ int main()
     static_assert( noexcept(swap(c1, c2)), "");
     }
 #endif
-
-#endif
 }

Modified: libcxx/trunk/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/multiset/multiset.special/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <set>
 
 // void swap(multiset& c)
@@ -22,6 +24,7 @@
 #include <set>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -93,7 +96,6 @@ struct some_alloc3
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     {
         typedef std::multiset<MoveOnly> C;
         C c1, c2;
@@ -143,6 +145,4 @@ int main()
     static_assert( noexcept(swap(c1, c2)), "");
     }
 #endif
-
-#endif
 }

Modified: libcxx/trunk/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/associative/set/set.special/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <set>
 
 // void swap(set& c)
@@ -22,6 +24,7 @@
 #include <set>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -93,7 +96,6 @@ struct some_alloc3
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     {
         typedef std::set<MoveOnly> C;
         C c1, c2;
@@ -144,5 +146,4 @@ int main()
     }
 #endif
 
-#endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.special/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <deque>
 
 // void swap(deque& c)
@@ -21,6 +23,7 @@
 #include <deque>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -51,7 +54,6 @@ struct some_alloc2
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     {
         typedef std::deque<MoveOnly> C;
         C c1, c2;
@@ -86,5 +88,4 @@ int main()
     }
 #endif
 
-#endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/forwardlist/forwardlist.spec/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <forward_list>
 
 // void swap(forward_list& c)
@@ -21,6 +23,7 @@
 #include <forward_list>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -51,7 +54,6 @@ struct some_alloc2
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     {
         typedef std::forward_list<MoveOnly> C;
         C c1, c2;
@@ -85,6 +87,4 @@ int main()
         static_assert( noexcept(swap(c1, c2)), "");
     }
 #endif
-
-#endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/list/list.special/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <list>
 
 // void swap(list& c)
@@ -21,6 +23,7 @@
 #include <list>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -51,7 +54,6 @@ struct some_alloc2
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     {
         typedef std::list<MoveOnly> C;
         C c1, c2;
@@ -86,5 +88,4 @@ int main()
     }
 #endif
 
-#endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector.bool/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <vector>
 
 // void swap(vector& c)
@@ -22,6 +24,7 @@
 #include <vector>
 #include <cassert>
 
+#include "test_macros.h"
 #include "test_allocator.h"
 
 template <class T>
@@ -51,7 +54,6 @@ struct some_alloc2
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     {
         typedef std::vector<bool> C;
         C c1, c2;
@@ -85,6 +87,4 @@ int main()
         static_assert( noexcept(swap(c1, c2)), "");
     }
 #endif
-
-#endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector/vector.special/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <vector>
 
 // void swap(vector& c)
@@ -22,6 +24,7 @@
 #include <vector>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -52,7 +55,6 @@ struct some_alloc2
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     {
         typedef std::vector<MoveOnly> C;
         C c1, c2;
@@ -86,6 +88,4 @@ int main()
         static_assert( noexcept(swap(c1, c2)), "");
     }
 #endif
-
-#endif
 }

Modified: libcxx/trunk/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.map/unord.map.swap/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <unordered_map>
 
 // void swap(unordered_map& c)
@@ -26,6 +28,7 @@
 #include <unordered_map>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -116,7 +119,6 @@ struct some_alloc3
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
 	typedef std::pair<const MoveOnly, MoveOnly> MapType;
     {
         typedef std::unordered_map<MoveOnly, MoveOnly> C;
@@ -195,5 +197,4 @@ int main()
     static_assert( noexcept(swap(c1, c2)), "");
     }
 #endif
-#endif
 }

Modified: libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.multimap/unord.multimap.swap/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <unordered_map>
 
 // void swap(unordered_multimap& c)
@@ -26,6 +28,7 @@
 #include <unordered_map>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -115,7 +118,6 @@ struct some_alloc3
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     typedef std::pair<const MoveOnly, MoveOnly> V;
     {
         typedef std::unordered_multimap<MoveOnly, MoveOnly> C;
@@ -193,6 +195,4 @@ int main()
     static_assert( noexcept(swap(c1, c2)), "");
     }
 #endif
-
-#endif
 }

Modified: libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.multiset/unord.multiset.swap/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <unordered_set>
 
 // void swap(unordered_multiset& c)
@@ -26,6 +28,7 @@
 #include <unordered_set>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -115,7 +118,6 @@ struct some_alloc3
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     {
         typedef std::unordered_multiset<MoveOnly> C;
         C c1, c2;
@@ -193,6 +195,4 @@ int main()
     static_assert( noexcept(swap(c1, c2)), "");
     }
 #endif
-
-#endif
 }

Modified: libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/unord/unord.set/unord.set.swap/swap_noexcept.pass.cpp Thu Apr 21 19:15:18 2016
@@ -7,6 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 
+// UNSUPPORTED: c++98, c++03
+
 // <unordered_set>
 
 // void swap(unordered_set& c)
@@ -26,6 +28,7 @@
 #include <unordered_set>
 #include <cassert>
 
+#include "test_macros.h"
 #include "MoveOnly.h"
 #include "test_allocator.h"
 
@@ -115,7 +118,6 @@ struct some_alloc3
 
 int main()
 {
-#if __has_feature(cxx_noexcept)
     {
         typedef std::unordered_set<MoveOnly> C;
         C c1, c2;
@@ -193,6 +195,4 @@ int main()
     static_assert( noexcept(swap(c1, c2)), "");
     }
 #endif
-
-#endif
 }

Modified: libcxx/trunk/www/cxx1z_status.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/cxx1z_status.html?rev=267085&r1=267084&r2=267085&view=diff
==============================================================================
--- libcxx/trunk/www/cxx1z_status.html (original)
+++ libcxx/trunk/www/cxx1z_status.html Thu Apr 21 19:15:18 2016
@@ -100,7 +100,7 @@
 <!--   <I>Note: "NAD" means that the issue was deemed "Not a defect"</I> -->
   <table id="issues" border="1">
 	<tr><th>Issue #</th><th>Issue Name</th><th>Meeting</th><th>Status</th></tr>
-	<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2016">2016</a></td><td>Allocators must be no-throw swappable</td><td>Urbana</td><td></td></tr>
+	<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2016">2016</a></td><td>Allocators must be no-throw swappable</td><td>Urbana</td><td>Complete</td></tr>
 	<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2376">2118</td><td><code>unique_ptr</code> for array does not support cv qualification conversion of actual argument</td><td>Urbana</td><td>Complete</td></tr>
 	<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2170">2170</a></td><td>Aggregates cannot be <code>DefaultConstructible</code></td><td>Urbana</td><td>Complete</td></tr>
 	<tr><td><a href="http://cplusplus.github.io/LWG/lwg-defects.html#2308">2308</td><td>Clarify container destructor requirements w.r.t. <code>std::array</code></td><td>Urbana</td><td>Complete</td></tr>




More information about the cfe-commits mailing list