[libcxx] r342070 - mark LWG#2953 as complete. No code changes required, but added a couple of extra tests.

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 12 11:51:12 PDT 2018


Author: marshall
Date: Wed Sep 12 11:51:12 2018
New Revision: 342070

URL: http://llvm.org/viewvc/llvm-project?rev=342070&view=rev
Log:
mark LWG#2953 as complete. No code changes required, but added a couple of extra tests.

Modified:
    libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
    libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
    libcxx/trunk/www/cxx2a_status.html

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp?rev=342070&r1=342069&r2=342070&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp Wed Sep 12 11:51:12 2018
@@ -18,6 +18,23 @@
 #include <cstddef>
 
 #include "min_allocator.h"
+#include "test_macros.h"
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+struct Throws {
+    Throws() : v_(0) {}
+    Throws(int v) : v_(v) {}
+    Throws(const Throws  &rhs) : v_(rhs.v_) { if (sThrows) throw 1; }
+    Throws(      Throws &&rhs) : v_(rhs.v_) { if (sThrows) throw 1; }
+    Throws& operator=(const Throws  &rhs) { v_ = rhs.v_; return *this; }
+    Throws& operator=(      Throws &&rhs) { v_ = rhs.v_; return *this; }
+    int v_;
+
+    static bool sThrows;
+    };
+         
+bool Throws::sThrows = false;
+#endif
 
 template <class C>
 C
@@ -90,4 +107,19 @@ int main()
             testN<std::deque<int, min_allocator<int>> >(rng[i], rng[j]);
     }
 #endif
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+// Test for LWG2953:
+// Throws: Nothing unless an exception is thrown by the assignment operator of T.
+// (which includes move assignment)
+    {
+    Throws arr[] = {1, 2, 3};
+    std::deque<Throws> v(arr, arr+3);
+    Throws::sThrows = true;
+    v.erase(v.begin());
+    v.erase(--v.end());
+    v.erase(v.begin());
+    assert(v.size() == 0);
+    }
+#endif
 }

Modified: libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp?rev=342070&r1=342069&r2=342070&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp Wed Sep 12 11:51:12 2018
@@ -20,6 +20,24 @@
 #include <cstddef>
 
 #include "min_allocator.h"
+#include "test_macros.h"
+
+#ifndef TEST_HAS_NO_EXCEPTIONS
+struct Throws {
+    Throws() : v_(0) {}
+    Throws(int v) : v_(v) {}
+    Throws(const Throws  &rhs) : v_(rhs.v_) { if (sThrows) throw 1; }
+    Throws(      Throws &&rhs) : v_(rhs.v_) { if (sThrows) throw 1; }
+    Throws& operator=(const Throws  &rhs) { v_ = rhs.v_; return *this; }
+    Throws& operator=(      Throws &&rhs) { v_ = rhs.v_; return *this; }
+    int v_;
+
+    static bool sThrows;
+    };
+         
+bool Throws::sThrows = false;
+#endif
+
 
 template <class C>
 C
@@ -96,4 +114,18 @@ int main()
             testN<std::deque<int, min_allocator<int>> >(rng[i], rng[j]);
     }
 #endif
+#ifndef TEST_HAS_NO_EXCEPTIONS
+// Test for LWG2953:
+// Throws: Nothing unless an exception is thrown by the assignment operator of T.
+// (which includes move assignment)
+    {
+    Throws arr[] = {1, 2, 3};
+    std::deque<Throws> v(arr, arr+3);
+    Throws::sThrows = true;
+    v.erase(v.begin(), --v.end());
+    assert(v.size() == 1);
+    v.erase(v.begin(), v.end());
+    assert(v.size() == 0);
+    }
+#endif
 }

Modified: libcxx/trunk/www/cxx2a_status.html
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/cxx2a_status.html?rev=342070&r1=342069&r2=342070&view=diff
==============================================================================
--- libcxx/trunk/www/cxx2a_status.html (original)
+++ libcxx/trunk/www/cxx2a_status.html Wed Sep 12 11:51:12 2018
@@ -73,7 +73,7 @@
 	<tr><td><a href="https://wg21.link/P0768R1">P0768R1</a></td><td>CWG</td><td>Library Support for the Spaceship (Comparison) Operator</td><td>Albuquerque</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0777R1">P0777R1</a></td><td>LWG</td><td>Treating Unnecessary <tt>decay</tt></td><td>Albuquerque</td><td>Complete</td><td>7.0</td></tr>
 	<tr><td><a href="https://wg21.link/P0122R7">P0122R7</a></td><td>LWG</td><td><span></td><td>Jacksonville</td><td>Complete</td><td>7.0</td></tr>
-	<tr><td><a href="https://wg21.link/P0355R7">P0355R7</a></td><td>LWG</td><td>Extending chrono to Calendars and Time Zones</td><td>Jacksonville</td><td></td><td><i>In progress</i></td></tr>
+	<tr><td><a href="https://wg21.link/P0355R7">P0355R7</a></td><td>LWG</td><td>Extending chrono to Calendars and Time Zones</td><td>Jacksonville</td><td><i>In progress</i></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0551R3">P0551R3</a></td><td>LWG</td><td>Thou Shalt Not Specialize <tt>std</tt> Function Templates!</td><td>Jacksonville</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0753R2">P0753R2</a></td><td>LWG</td><td>Manipulators for C++ Synchronized Buffered Ostream</td><td>Jacksonville</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0754R2">P0754R2</a></td><td>LWG</td><td><version></td><td>Jacksonville</td><td>Complete</td><td>7.0</td></tr>
@@ -89,7 +89,7 @@
 	<tr><td><a href="https://wg21.link/P0476R2">P0476R2</a></td><td>LWG</td><td>Bit-casting object representations</td><td>Rapperswil</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0528R3">P0528R3</a></td><td>CWG</td><td>The Curious Case of Padding Bits, Featuring Atomic Compare-and-Exchange</td><td>Rapperswil</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0542R5">P0542R5</a></td><td>CWG</td><td>Support for contract based programming in C++</td><td>Rapperswil</td><td></td><td></td></tr>
-	<tr><td><a href="https://wg21.link/P0556R3">P0556R3</a></td><td>LWG</td><td>Integral power-of-2 operations</td><td>Rapperswil</td><td><i>In Progress</i></td><td><i>In progress</i></td></tr>
+	<tr><td><a href="https://wg21.link/P0556R3">P0556R3</a></td><td>LWG</td><td>Integral power-of-2 operations</td><td>Rapperswil</td><td><i>In Progress</i></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0619R4">P0619R4</a></td><td>LWG</td><td>Reviewing Deprecated Facilities of C++17 for C++20</td><td>Rapperswil</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0646R1">P0646R1</a></td><td>LWG</td><td>Improving the Return Value of Erase-Like Algorithms</td><td>Rapperswil</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0722R3">P0722R3</a></td><td>CWG</td><td>Efficient sized delete for variable sized classes</td><td>Rapperswil</td><td></td><td></td></tr>
@@ -102,7 +102,7 @@
 	<tr><td><a href="https://wg21.link/P0892R2">P0892R2</a></td><td>CWG</td><td>explicit(bool)</td><td>Rapperswil</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0898R3">P0898R3</a></td><td>LWG</td><td>Standard Library Concepts</td><td>Rapperswil</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P0935R0">P0935R0</a></td><td>LWG</td><td>Eradicating unnecessarily explicit default constructors from the standard library</td><td>Rapperswil</td><td></td><td></td></tr>
-	<tr><td><a href="https://wg21.link/P0941R2">P0941R2</a></td><td>CWG</td><td>Integrating feature-test macros into the C++ WD</td><td>Rapperswil</td><td></td><td><i>In progress</i></td></tr>
+	<tr><td><a href="https://wg21.link/P0941R2">P0941R2</a></td><td>CWG</td><td>Integrating feature-test macros into the C++ WD</td><td>Rapperswil</td><td><i>In progress</i></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P1023R0">P1023R0</a></td><td>LWG</td><td>constexpr comparison operators for std::array</td><td>Rapperswil</td><td>Complete</td><td>8.0</td></tr>
 	<tr><td><a href="https://wg21.link/P1025R1">P1025R1</a></td><td>CWG</td><td>Update The Reference To The Unicode Standard</td><td>Rapperswil</td><td></td><td></td></tr>
 	<tr><td><a href="https://wg21.link/P1120R0">P1120R0</a></td><td>CWG</td><td>Consistency improvements for <=> and other comparison operators</td><td>Rapperswil</td><td></td><td></td></tr>
@@ -149,7 +149,7 @@
 	<tr><td><a href="https://wg21.link/LWG2950">2950</a></td><td>std::byte operations are misspecified</td><td>Albuquerque</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2952">2952</a></td><td>iterator_traits should work for pointers to cv T</td><td>Albuquerque</td><td>Complete</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2953">2953</a></td><td>LWG 2853 should apply to deque::erase too</td><td>Albuquerque</td><td></td></tr>
-	<tr><td><a href="https://wg21.link/LWG2958">2958</a></td><td>Moves improperly defined as deleted</td><td>Albuquerque</td><td></td></tr>
+	<tr><td><a href="https://wg21.link/LWG2958">2958</a></td><td>Moves improperly defined as deleted</td><td>Albuquerque</td><td><I>We already do this</I></td></tr>
 	<tr><td><a href="https://wg21.link/LWG2964">2964</a></td><td>Apparently redundant requirement for dynamic_pointer_cast</td><td>Albuquerque</td><td></td></tr>
 	<tr><td><a href="https://wg21.link/LWG2965">2965</a></td><td>Non-existing path::native_string() in filesystem_error::what() specification</td><td>Albuquerque</td><td>Nothing to do</td></tr>
 	<tr><td><a href="https://wg21.link/LWG2972">2972</a></td><td>What is is_trivially_destructible_v<int>?</td><td>Albuquerque</td><td>Complete</td></tr>
@@ -222,7 +222,7 @@
 <!-- 	<tr><td></td><td></td><td></td><td></td></tr> -->
   </table>
 
-  <p>Last Updated: 11-Sep-2018</p>
+  <p>Last Updated: 12-Sep-2018</p>
 </div>
 </body>
 </html>




More information about the cfe-commits mailing list