[libcxx-commits] [libcxx] [libc++] Optimize copy construction and assignment of __tree (PR #151304)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jul 31 06:04:44 PDT 2025


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 HEAD~1 HEAD --extensions ,h,cpp -- libcxx/include/__tree libcxx/include/map libcxx/include/set libcxx/test/benchmarks/containers/associative/associative_container_benchmarks.h libcxx/test/benchmarks/containers/associative/map.bench.cpp libcxx/test/benchmarks/containers/associative/set.bench.cpp libcxx/test/std/containers/associative/map/map.cons/copy.pass.cpp libcxx/test/std/containers/associative/map/map.cons/copy_alloc.pass.cpp libcxx/test/std/containers/associative/map/map.cons/copy_assign.pass.cpp libcxx/test/std/containers/associative/set/set.cons/copy.pass.cpp libcxx/test/std/containers/associative/set/set.cons/copy_alloc.pass.cpp libcxx/test/std/containers/associative/set/set.cons/copy_assign.pass.cpp
``````````

</details>

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

``````````diff
diff --git a/libcxx/test/std/containers/associative/map/map.cons/copy_alloc.pass.cpp b/libcxx/test/std/containers/associative/map/map.cons/copy_alloc.pass.cpp
index ac3f299e5..5a6e509ae 100644
--- a/libcxx/test/std/containers/associative/map/map.cons/copy_alloc.pass.cpp
+++ b/libcxx/test/std/containers/associative/map/map.cons/copy_alloc.pass.cpp
@@ -81,7 +81,7 @@ void test_alloc(const Alloc& new_alloc) {
 void test() {
   test_alloc(std::allocator<std::pair<const int, int>>());
   test_alloc(test_allocator<std::pair<const int, int>>(25)); // Make sure that the new allocator is acutually used
-  test_alloc(min_allocator<std::pair<const int, int>>()); // Make sure that fancy pointers work
+  test_alloc(min_allocator<std::pair<const int, int>>());    // Make sure that fancy pointers work
 
   { // Ensure that the comparator is copied
     using V = std::pair<const int, int>;
diff --git a/libcxx/test/std/containers/associative/set/set.cons/copy_alloc.pass.cpp b/libcxx/test/std/containers/associative/set/set.cons/copy_alloc.pass.cpp
index c0d495d4c..e3e678f99 100644
--- a/libcxx/test/std/containers/associative/set/set.cons/copy_alloc.pass.cpp
+++ b/libcxx/test/std/containers/associative/set/set.cons/copy_alloc.pass.cpp
@@ -78,7 +78,7 @@ void test_alloc(const Alloc& new_alloc) {
 void test() {
   test_alloc(std::allocator<int>());
   test_alloc(test_allocator<int>(25)); // Make sure that the new allocator is acutually used
-  test_alloc(min_allocator<int>()); // Make sure that fancy pointers work
+  test_alloc(min_allocator<int>());    // Make sure that fancy pointers work
 
   { // Ensure that the comparator is copied
     int arr[] = {1, 2, 3};

``````````

</details>


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


More information about the libcxx-commits mailing list