[libcxx-commits] [libcxx] [libc++][test] Fix and refactor exception tests for std::vector (PR #117662)

Peng Liu via libcxx-commits libcxx-commits at lists.llvm.org
Mon Nov 25 19:56:47 PST 2024


================
@@ -192,51 +115,52 @@ int main(int, char**) {
 
   try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from allocator
     int a[] = {1, 2};
-    Allocator<int> alloc(false);
+    throwing_allocator<int> alloc(false, true); // throw on copy only
     AllocVec vec(forward_iterator<int*>(a), forward_iterator<int*>(a + 2), alloc);
   } catch (int) {
----------------
winner245 wrote:

This test did not throw.

https://github.com/llvm/llvm-project/pull/117662


More information about the libcxx-commits mailing list