diff --git a/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp index def032c27..f323ca432 100644 --- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp +++ b/test/std/containers/sequences/deque/deque.modifiers/erase_iter.pass.cpp @@ -18,6 +18,23 @@ #include #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 C @@ -90,4 +107,19 @@ int main() testN> >(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 v(arr, arr+3); + Throws::sThrows = true; + v.erase(v.begin()); + v.erase(--v.end()); + v.erase(v.begin()); + assert(v.size() == 0); + } +#endif } diff --git a/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp b/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp index 338c66d81..391a0f79d 100644 --- a/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp +++ b/test/std/containers/sequences/deque/deque.modifiers/erase_iter_iter.pass.cpp @@ -20,6 +20,24 @@ #include #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 C @@ -96,4 +114,18 @@ int main() testN> >(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 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 } diff --git a/www/cxx2a_status.html b/www/cxx2a_status.html index 84ebb02e2..1ffda09fd 100644 --- a/www/cxx2a_status.html +++ b/www/cxx2a_status.html @@ -73,7 +73,7 @@ P0768R1CWGLibrary Support for the Spaceship (Comparison) OperatorAlbuquerque P0777R1LWGTreating Unnecessary decayAlbuquerqueComplete7.0 P0122R7LWG<span>JacksonvilleComplete7.0 - P0355R7LWGExtending chrono to Calendars and Time ZonesJacksonvilleIn progress + P0355R7LWGExtending chrono to Calendars and Time ZonesJacksonvilleIn progress P0551R3LWGThou Shalt Not Specialize std Function Templates!Jacksonville P0753R2LWGManipulators for C++ Synchronized Buffered OstreamJacksonville P0754R2LWG<version>JacksonvilleComplete7.0 @@ -89,7 +89,7 @@ P0476R2LWGBit-casting object representationsRapperswil P0528R3CWGThe Curious Case of Padding Bits, Featuring Atomic Compare-and-ExchangeRapperswil P0542R5CWGSupport for contract based programming in C++Rapperswil - P0556R3LWGIntegral power-of-2 operationsRapperswilIn ProgressIn progress + P0556R3LWGIntegral power-of-2 operationsRapperswilIn Progress P0619R4LWGReviewing Deprecated Facilities of C++17 for C++20Rapperswil P0646R1LWGImproving the Return Value of Erase-Like AlgorithmsRapperswil P0722R3CWGEfficient sized delete for variable sized classesRapperswil @@ -102,7 +102,7 @@ P0892R2CWGexplicit(bool)Rapperswil P0898R3LWGStandard Library ConceptsRapperswil P0935R0LWGEradicating unnecessarily explicit default constructors from the standard libraryRapperswil - P0941R2CWGIntegrating feature-test macros into the C++ WDRapperswilIn progress + P0941R2CWGIntegrating feature-test macros into the C++ WDRapperswilIn progress P1023R0LWGconstexpr comparison operators for std::arrayRapperswilComplete8.0 P1025R1CWGUpdate The Reference To The Unicode StandardRapperswil P1120R0CWGConsistency improvements for <=> and other comparison operatorsRapperswil @@ -149,7 +149,7 @@ 2950std::byte operations are misspecifiedAlbuquerqueComplete 2952iterator_traits should work for pointers to cv TAlbuquerqueComplete 2953LWG 2853 should apply to deque::erase tooAlbuquerque - 2958Moves improperly defined as deletedAlbuquerque + 2958Moves improperly defined as deletedAlbuquerqueWe already do this 2964Apparently redundant requirement for dynamic_pointer_castAlbuquerque 2965Non-existing path::native_string() in filesystem_error::what() specificationAlbuquerqueNothing to do 2972What is is_trivially_destructible_v<int>?AlbuquerqueComplete @@ -222,7 +222,7 @@ -

Last Updated: 11-Sep-2018

+

Last Updated: 12-Sep-2018