[libcxx-commits] [libcxx] [libc++] Fix vector::append_range growing before the capacity is reached (PR #183264)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 26 03:00:40 PST 2026


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 origin/main HEAD --extensions cpp,h -- libcxx/include/__vector/vector.h libcxx/test/std/containers/sequences/vector/vector.modifiers/append_range.pass.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/libcxx/test/std/containers/sequences/vector/vector.modifiers/append_range.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.modifiers/append_range.pass.cpp
index 6810ba73d..78dd44482 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.modifiers/append_range.pass.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.modifiers/append_range.pass.cpp
@@ -51,7 +51,7 @@ constexpr bool test() {
       std::vector<int> v = {1, 2, 3, 4, 5, 6, 7, 8};
       v.reserve(v.size() + std::ranges::size(in));
 
-      auto ptr = v.data();
+      auto ptr     = v.data();
       auto old_cap = v.capacity();
 
       v.append_range(in);

``````````

</details>


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


More information about the libcxx-commits mailing list