[libcxx-commits] [libcxx] [libc++] Fix `reverse_iterator` when underlying is c++20 bidirectional_iterator but not c++17 BidirectionalIterator (PR #112100)
via libcxx-commits
libcxx-commits at lists.llvm.org
Sat Oct 12 08:25:44 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 6a6af0246bd2d68291582e9aefc0543e5c6102fe 9d322c29c1d7e18abb0126cc7ef40ecb73fdd8ac --extensions h,cpp -- libcxx/include/__iterator/reverse_iterator.h libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/equal.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater-equal.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less-equal.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/not-equal.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/assign.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.default.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.iter.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cons/ctor.reverse_iterator.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.conv/base.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/decrement-assign.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/increment-assign.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/minus.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/plus.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postdecrement.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postincrement.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/predecrement.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/preincrement.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/make_reverse_iterator.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/minus.pass.cpp libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/plus.pass.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/equal.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/equal.pass.cpp
index b5cb1324a5..6fe575ebdd 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/equal.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/equal.pass.cpp
@@ -35,7 +35,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), false);
#if TEST_STD_VER >= 20
test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s), true);
- test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s+1), false);
+ test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s + 1), false);
#endif
test(s, s, true);
test(s, s+1, false);
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater-equal.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater-equal.pass.cpp
index 3c37dce13d..b2bfdb56d6 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater-equal.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater-equal.pass.cpp
@@ -34,8 +34,8 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s), false);
#if TEST_STD_VER >= 20
test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s), true);
- test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s+1), true);
- test(cpp20_random_access_iterator<const char*>(s+1), cpp20_random_access_iterator<const char*>(s), false);
+ test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s + 1), true);
+ test(cpp20_random_access_iterator<const char*>(s + 1), cpp20_random_access_iterator<const char*>(s), false);
#endif
test(s, s, true);
test(s, s+1, true);
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater.pass.cpp
index 288691b714..38f9258de3 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/greater.pass.cpp
@@ -34,8 +34,8 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s), false);
#if TEST_STD_VER >= 20
test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s), false);
- test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s+1), true);
- test(cpp20_random_access_iterator<const char*>(s+1), cpp20_random_access_iterator<const char*>(s), false);
+ test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s + 1), true);
+ test(cpp20_random_access_iterator<const char*>(s + 1), cpp20_random_access_iterator<const char*>(s), false);
#endif
test(s, s, false);
test(s, s+1, true);
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less-equal.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less-equal.pass.cpp
index f7babf1ff4..a57930b111 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less-equal.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less-equal.pass.cpp
@@ -34,8 +34,8 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s), true);
#if TEST_STD_VER >= 20
test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s), true);
- test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s+1), false);
- test(cpp20_random_access_iterator<const char*>(s+1), cpp20_random_access_iterator<const char*>(s), true);
+ test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s + 1), false);
+ test(cpp20_random_access_iterator<const char*>(s + 1), cpp20_random_access_iterator<const char*>(s), true);
#endif
test(s, s, true);
test(s, s+1, false);
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less.pass.cpp
index 6f3d82c234..4cd3f249d0 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/less.pass.cpp
@@ -34,8 +34,8 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s), true);
#if TEST_STD_VER >= 20
test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s), false);
- test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s+1), false);
- test(cpp20_random_access_iterator<const char*>(s+1), cpp20_random_access_iterator<const char*>(s), true);
+ test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s + 1), false);
+ test(cpp20_random_access_iterator<const char*>(s + 1), cpp20_random_access_iterator<const char*>(s), true);
#endif
test(s, s, false);
test(s, s+1, false);
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/not-equal.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/not-equal.pass.cpp
index 1b921ace4a..509ac297c3 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/not-equal.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.cmp/not-equal.pass.cpp
@@ -35,7 +35,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(random_access_iterator<const char*>(s), random_access_iterator<const char*>(s+1), true);
#if TEST_STD_VER >= 20
test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s), false);
- test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s+1), true);
+ test(cpp20_random_access_iterator<const char*>(s), cpp20_random_access_iterator<const char*>(s + 1), true);
#endif
test(s, s, false);
test(s, s+1, true);
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.conv/base.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.conv/base.pass.cpp
index ded372a32b..c0a7f4d72c 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.conv/base.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.conv/base.pass.cpp
@@ -20,26 +20,26 @@
template <class Iter>
TEST_CONSTEXPR_CXX17 void test() {
- int i = 0;
- Iter iter(&i);
- std::reverse_iterator<Iter> const reverse(iter);
- typename std::reverse_iterator<Iter>::iterator_type base = reverse.base();
- assert(base == Iter(&i));
+ int i = 0;
+ Iter iter(&i);
+ std::reverse_iterator<Iter> const reverse(iter);
+ typename std::reverse_iterator<Iter>::iterator_type base = reverse.base();
+ assert(base == Iter(&i));
}
TEST_CONSTEXPR_CXX17 bool tests() {
- test<bidirectional_iterator<int*> >();
- test<random_access_iterator<int*> >();
+ test<bidirectional_iterator<int*> >();
+ test<random_access_iterator<int*> >();
#if TEST_STD_VER >= 20
- test<cpp20_random_access_iterator<int*>>();
+ test<cpp20_random_access_iterator<int*>>();
#endif
- return true;
+ return true;
}
int main(int, char**) {
- tests();
+ tests();
#if TEST_STD_VER > 14
- static_assert(tests(), "");
+ static_assert(tests(), "");
#endif
return 0;
}
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
index ac862ef1a2..4e11f68dc7 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/arrow.pass.cpp
@@ -31,7 +31,7 @@ class cpp20_bidirectional_iterator_with_arrow {
public:
using iterator_category = std::input_iterator_tag;
- using iterator_concept = std::bidirectional_iterator_tag;
+ using iterator_concept = std::bidirectional_iterator_tag;
using value_type = std::iterator_traits<It>::value_type;
using difference_type = std::iterator_traits<It>::difference_type;
@@ -68,7 +68,7 @@ public:
return x.it_ != y.it_;
}
- friend It base(const cpp20_bidirectional_iterator_with_arrow& i) { return i.it_; }
+ friend It base(const cpp20_bidirectional_iterator_with_arrow& i) { return i.it_; }
};
#endif
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp
index 59bea3a623..8b45bfa09b 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/bracket.pass.cpp
@@ -34,8 +34,8 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(random_access_iterator<const char*>(s+5), 4, '1');
test(random_access_iterator<const char*>(s+5), 0, '5');
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+5), 4, '1');
- test(cpp20_random_access_iterator<const char*>(s+5), 0, '5');
+ test(cpp20_random_access_iterator<const char*>(s + 5), 4, '1');
+ test(cpp20_random_access_iterator<const char*>(s + 5), 0, '5');
#endif
test(s+5, 4, '1');
test(s+5, 0, '5');
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
index f568a918a6..c3a489085c 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.elem/dereference.pass.cpp
@@ -48,9 +48,9 @@ int main(int, char**)
{
A a;
test(&a+1, A());
- test(random_access_iterator<A*>(&a+1), A());
+ test(random_access_iterator<A*>(&a + 1), A());
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<A*>(&a+1), A());
+ test(cpp20_random_access_iterator<A*>(&a + 1), A());
#endif
#if TEST_STD_VER > 14
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/decrement-assign.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/decrement-assign.pass.cpp
index dd5fd2c886..91c2d93636 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/decrement-assign.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/decrement-assign.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10));
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+5), 5, cpp20_random_access_iterator<const char*>(s+10));
+ test(cpp20_random_access_iterator<const char*>(s + 5), 5, cpp20_random_access_iterator<const char*>(s + 10));
#endif
test(s+5, 5, s+10);
return true;
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/increment-assign.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/increment-assign.pass.cpp
index 74ab3f9618..a449d0458f 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/increment-assign.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/increment-assign.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
char const* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+5), 5, cpp20_random_access_iterator<const char*>(s));
+ test(cpp20_random_access_iterator<const char*>(s + 5), 5, cpp20_random_access_iterator<const char*>(s));
#endif
test(s+5, 5, s);
return true;
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/minus.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/minus.pass.cpp
index 816c11c65d..8d108fa862 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/minus.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/minus.pass.cpp
@@ -30,7 +30,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s+10));
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+5), 5, cpp20_random_access_iterator<const char*>(s+10));
+ test(cpp20_random_access_iterator<const char*>(s + 5), 5, cpp20_random_access_iterator<const char*>(s + 10));
#endif
test(s+5, 5, s+10);
return true;
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/plus.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/plus.pass.cpp
index 72640cd0ec..905c2d9a2d 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/plus.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/plus.pass.cpp
@@ -30,7 +30,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+5), 5, cpp20_random_access_iterator<const char*>(s));
+ test(cpp20_random_access_iterator<const char*>(s + 5), 5, cpp20_random_access_iterator<const char*>(s));
#endif
test(s+5, 5, s);
return true;
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postdecrement.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postdecrement.pass.cpp
index 746fa38e60..f0551b5efe 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postdecrement.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postdecrement.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s+2));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s+2));
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+1), cpp20_random_access_iterator<const char*>(s+2));
+ test(cpp20_random_access_iterator<const char*>(s + 1), cpp20_random_access_iterator<const char*>(s + 2));
#endif
test(s+1, s+2);
return true;
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postincrement.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postincrement.pass.cpp
index ac95a8a2bb..f1d3ea21a5 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postincrement.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/postincrement.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s));
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+1), cpp20_random_access_iterator<const char*>(s));
+ test(cpp20_random_access_iterator<const char*>(s + 1), cpp20_random_access_iterator<const char*>(s));
#endif
test(s+1, s);
return true;
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/predecrement.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/predecrement.pass.cpp
index 6611bca7ec..5a2ac78570 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/predecrement.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/predecrement.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s+2));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s+2));
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+1), cpp20_random_access_iterator<const char*>(s+2));
+ test(cpp20_random_access_iterator<const char*>(s + 1), cpp20_random_access_iterator<const char*>(s + 2));
#endif
test(s+1, s+2);
return true;
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/preincrement.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/preincrement.pass.cpp
index 195f7ee980..6087eedd24 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/preincrement.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nav/preincrement.pass.cpp
@@ -31,7 +31,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
test(bidirectional_iterator<const char*>(s+1), bidirectional_iterator<const char*>(s));
test(random_access_iterator<const char*>(s+1), random_access_iterator<const char*>(s));
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+1), cpp20_random_access_iterator<const char*>(s));
+ test(cpp20_random_access_iterator<const char*>(s + 1), cpp20_random_access_iterator<const char*>(s));
#endif
test(s+1, s);
return true;
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/make_reverse_iterator.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/make_reverse_iterator.pass.cpp
index fd21eaaab6..7d4eea1642 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/make_reverse_iterator.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/make_reverse_iterator.pass.cpp
@@ -23,27 +23,27 @@
template <class It>
TEST_CONSTEXPR_CXX17 void test_one(It i) {
- const std::reverse_iterator<It> r = std::make_reverse_iterator(i);
- assert(r.base() == i);
+ const std::reverse_iterator<It> r = std::make_reverse_iterator(i);
+ assert(r.base() == i);
}
template <class It>
TEST_CONSTEXPR_CXX17 void test() {
- const char* s = "1234567890";
- It b(s);
- It e(s+10);
- while (b != e)
- test_one (b++);
+ const char* s = "1234567890";
+ It b(s);
+ It e(s + 10);
+ while (b != e)
+ test_one(b++);
}
TEST_CONSTEXPR_CXX17 bool tests() {
- test<const char*>();
- test<bidirectional_iterator<const char*>>();
- test<random_access_iterator<const char*>>();
+ test<const char*>();
+ test<bidirectional_iterator<const char*>>();
+ test<random_access_iterator<const char*>>();
#if TEST_STD_VER >= 20
- test<cpp20_random_access_iterator<const char*>>();
+ test<cpp20_random_access_iterator<const char*>>();
#endif
- return true;
+ return true;
}
int main(int, char**) {
diff --git a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/plus.pass.cpp b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/plus.pass.cpp
index 06a22c74c4..9ead123781 100644
--- a/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/plus.pass.cpp
+++ b/libcxx/test/std/iterators/predef.iterators/reverse.iterators/reverse.iter.nonmember/plus.pass.cpp
@@ -30,7 +30,7 @@ TEST_CONSTEXPR_CXX17 bool tests() {
const char* s = "1234567890";
test(random_access_iterator<const char*>(s+5), 5, random_access_iterator<const char*>(s));
#if TEST_STD_VER >= 20
- test(cpp20_random_access_iterator<const char*>(s+5), 5, cpp20_random_access_iterator<const char*>(s));
+ test(cpp20_random_access_iterator<const char*>(s + 5), 5, cpp20_random_access_iterator<const char*>(s));
#endif
test(s+5, 5, s);
return true;
``````````
</details>
https://github.com/llvm/llvm-project/pull/112100
More information about the libcxx-commits
mailing list