[libcxx-commits] [libcxx] [libc++] Fix several double-moves in the code base (PR #104616)

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 16 10:11:13 PDT 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 c4bf949171a72383d5ba4d2b587d4cc496aacebb eaabc75e361a6049bdcf82992da8ac81f4bcd575 --extensions cpp,h -- libcxx/test/std/ranges/range.utility/range.subrange/begin_end.pass.cpp libcxx/test/support/double_move_tracker.h libcxx/include/__algorithm/partition.h libcxx/include/__pstl/backends/default.h libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp libcxx/test/std/algorithms/alg.nonmodifying/alg.ends_with/ranges.ends_with.pass.cpp libcxx/test/support/test_iterators.h
``````````

</details>

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

``````````diff
diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
index 87beba183a..8c9efbcbea 100644
--- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
+++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.partitions/partition.pass.cpp
@@ -98,16 +98,16 @@ test()
 
 int main(int, char**)
 {
-    test<forward_iterator<int*> >();
-    test<bidirectional_iterator<int*> >();
-    test<random_access_iterator<int*> >();
-    test<int*>();
+  test<forward_iterator<int*> >();
+  test<bidirectional_iterator<int*> >();
+  test<random_access_iterator<int*> >();
+  test<int*>();
 
 #if TEST_STD_VER >= 20
-    static_assert(test<forward_iterator<int*>>());
-    static_assert(test<bidirectional_iterator<int*>>());
-    static_assert(test<random_access_iterator<int*>>());
-    static_assert(test<int*>());
+  static_assert(test<forward_iterator<int*>>());
+  static_assert(test<bidirectional_iterator<int*>>());
+  static_assert(test<random_access_iterator<int*>>());
+  static_assert(test<int*>());
 #endif
 
     return 0;
diff --git a/libcxx/test/support/test_iterators.h b/libcxx/test/support/test_iterators.h
index 419f1d8673..ab8d5b510d 100644
--- a/libcxx/test/support/test_iterators.h
+++ b/libcxx/test/support/test_iterators.h
@@ -702,7 +702,7 @@ class cpp20_input_iterator
     It it_;
     support::double_move_tracker tracker_;
 
-public:
+  public:
     using value_type = std::iter_value_t<It>;
     using difference_type = std::iter_difference_t<It>;
     using iterator_concept = std::input_iterator_tag;

``````````

</details>


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


More information about the libcxx-commits mailing list