[libcxx-commits] [libcxx] [libc++] Add exception guard for vector<bool>::__init_with_sentinel (PR #115491)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Nov 26 16:36:23 PST 2024


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff 991dcbc468763953f4b4e65fa3448e147cba5bba bfcd2378d22144bc175298dfbfde486a7f5a8d2e --extensions h,cpp -- libcxx/test/std/containers/sequences/vector/common.h libcxx/include/__vector/vector_bool.h libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp b/libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp
index fe8cf48737..cb2b7d124e 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/ctor_exceptions.pass.cpp
@@ -30,7 +30,7 @@ int main(int, char**) {
   check_new_delete_called();
 
 #if TEST_STD_VER >= 14
-  try { // Throw in vector(size_type, const allocator_type&) from allocator 
+  try { // Throw in vector(size_type, const allocator_type&) from allocator
     throwing_allocator<bool> alloc(/*throw_on_ctor = */ false, /*throw_on_copy = */ true);
     AllocVec get_alloc(0, alloc);
   } catch (int) {
@@ -84,7 +84,7 @@ int main(int, char**) {
   check_new_delete_called();
 
   try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from allocator
-    bool a[] = {true, false}; 
+    bool a[] = {true, false};
     throwing_allocator<bool> alloc(/*throw_on_ctor = */ false, /*throw_on_copy = */ true);
     AllocVec vec(cpp17_input_iterator<bool*>(a), cpp17_input_iterator<bool*>(a + 2), alloc);
   } catch (int) {
@@ -92,7 +92,7 @@ int main(int, char**) {
   check_new_delete_called();
 
   try { // Throw in vector(InputIterator, InputIterator, const allocator_type&) from allocator
-    bool a[] = {true, false}; 
+    bool a[] = {true, false};
     throwing_allocator<bool> alloc(/*throw_on_ctor = */ false, /*throw_on_copy = */ true);
     AllocVec vec(forward_iterator<bool*>(a), forward_iterator<bool*>(a + 2), alloc);
   } catch (int) {

``````````

</details>


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


More information about the libcxx-commits mailing list