[libcxx-commits] [libcxx] [libc++][test] Add exception tests for vector capacity operations (PR #118141)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Dec 19 08:45:44 PST 2024
================
@@ -0,0 +1,313 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// UNSUPPORTED: no-exceptions
+
+// This test file validates that std::vector<T>::reserve provides a strong exception guarantee if T is
+// Cpp17MoveInsertible and no exception is thrown by the move constructor of T during the reserve call.
+// It also checks that if T's move constructor is not noexcept, reserve provides only a basic exception
+// guarantee.
----------------
ldionne wrote:
```suggestion
// This test file validates that std::vector<T>::reserve provides the strong exception guarantee if T is
// Cpp17MoveInsertable and no exception is thrown by the move constructor of T during the reserve call.
// It also checks that if T's move constructor is not noexcept, reserve provides only the basic exception
// guarantee.
```
https://github.com/llvm/llvm-project/pull/118141
More information about the libcxx-commits
mailing list