Skip to content

Commit 8c60052

Browse files
clang format
1 parent 35796db commit 8c60052

File tree

14 files changed

+63
-68
lines changed

14 files changed

+63
-68
lines changed

libcxx/test/std/ranges/range.adaptors/range.concat/begin.pass.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,17 @@ template <class T>
2222
concept HasBegin = requires(T& t) { t.begin(); };
2323

2424
template <class T>
25-
concept HasConstAndNonConstBegin =
26-
HasConstBegin<T> &&
27-
requires(T& t, const T& ct) { requires !std::same_as<decltype(t.begin()), decltype(ct.begin())>; };
25+
concept HasConstAndNonConstBegin = HasConstBegin<T> && requires(T& t, const T& ct) {
26+
requires !std::same_as<decltype(t.begin()), decltype(ct.begin())>;
27+
};
2828

2929
template <class T>
30-
concept HasOnlyNonConstBegin = HasBegin<T> && !
31-
HasConstBegin<T>;
30+
concept HasOnlyNonConstBegin = HasBegin<T> && !HasConstBegin<T>;
3231

3332
template <class T>
34-
concept HasOnlyConstBegin = HasConstBegin<T> && !
35-
HasConstAndNonConstBegin<T>;
33+
concept HasOnlyConstBegin = HasConstBegin<T> && !HasConstAndNonConstBegin<T>;
3634

3735
constexpr void tests() {
38-
3936
// check the case of simple view
4037
{
4138
int buffer[4] = {1, 2, 3, 4};
@@ -82,8 +79,6 @@ constexpr void tests() {
8279
assert(*it == 1);
8380
assert(it + 4 == view.end());
8481
}
85-
86-
8782
}
8883

8984
constexpr bool test() {

libcxx/test/std/ranges/range.adaptors/range.concat/ctor.default.pass.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ struct NoexceptView : std::ranges::view_base {
4040
};
4141

4242
struct HelperView : std::ranges::view_base {
43-
constexpr HelperView(const int* begin, const int *end) : begin_(begin), end_(end) {}
43+
constexpr HelperView(const int* begin, const int* end) : begin_(begin), end_(end) {}
4444
constexpr int const* begin() const { return begin_; }
4545
constexpr int const* end() const { return end_; }
4646

@@ -66,8 +66,8 @@ constexpr void test_with_one_view() {
6666
constexpr void test_with_more_than_one_view() {
6767
{
6868
using View = std::ranges::concat_view<HelperView, HelperView>;
69-
int arr1[] = {1,2};
70-
int arr2[] = {3,4};
69+
int arr1[] = {1, 2};
70+
int arr2[] = {3, 4};
7171
HelperView range1(arr1, arr1 + 2);
7272
HelperView range2(arr2, arr2 + 2);
7373
View view(range1, range2);
@@ -81,15 +81,12 @@ constexpr void test_with_more_than_one_view() {
8181
}
8282
}
8383

84-
constexpr bool tests()
85-
{
84+
constexpr bool tests() {
8685
test_with_one_view();
8786
test_with_more_than_one_view();
8887

8988
// Check cases where the default constructor isn't provided
90-
{
91-
static_assert(!std::is_default_constructible_v<std::ranges::concat_view<NoDefaultView >>);
92-
}
89+
{ static_assert(!std::is_default_constructible_v<std::ranges::concat_view<NoDefaultView >>); }
9390

9491
// Check noexcept-ness
9592
{

libcxx/test/std/ranges/range.adaptors/range.concat/ctor.verify.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ struct NoSizeRange : std::ranges::view_base {
1919
};
2020

2121
int main(int, char**) {
22-
2322
{
2423
// LWG 4082
2524
std::vector<int> v{1, 2, 3};
@@ -30,7 +29,7 @@ int main(int, char**) {
3029

3130
{
3231
// input is not a view
33-
int x = 1;
32+
int x = 1;
3433
auto c = std::views::concat(x);
3534
// expected-error@*:* {{}}
3635
}
@@ -43,7 +42,7 @@ int main(int, char**) {
4342

4443
{
4544
// inputs are non-concatable
46-
std::vector<int> v1{1,2};
45+
std::vector<int> v1{1, 2};
4746
std::vector<std::string> v2{"Hello", "World"};
4847
auto c = std::views::concat(v1, v2);
4948
// expected-error@*:* {{}}

libcxx/test/std/ranges/range.adaptors/range.concat/ctor.view.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ struct Range : std::ranges::view_base {
2525
};
2626

2727
struct MoveAwareView : std::ranges::view_base {
28-
int moves = 0;
28+
int moves = 0;
2929
constexpr MoveAwareView() = default;
3030
constexpr MoveAwareView(MoveAwareView&& other) : moves(other.moves + 1) { other.moves = 1; }
3131
constexpr MoveAwareView& operator=(MoveAwareView&& other) {
32-
moves = other.moves + 1;
32+
moves = other.moves + 1;
3333
other.moves = 0;
3434
return *this;
3535
}
@@ -38,7 +38,7 @@ struct MoveAwareView : std::ranges::view_base {
3838
};
3939

4040
constexpr bool test() {
41-
int buff[] = {1, 2};
41+
int buff[] = {1, 2};
4242
int buff2[] = {3, 4};
4343

4444
// constructor from views

libcxx/test/std/ranges/range.adaptors/range.concat/end.pass.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "types.h"
1616

1717
constexpr bool test() {
18-
1918
int buffer1[5] = {1, 2, 3, 4, 5};
2019
int buffer2[2] = {6, 7};
2120

libcxx/test/std/ranges/range.adaptors/range.concat/iterator/compare.pass.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ constexpr void test() {
5151
std::same_as<bool> decltype(auto) result = (it1 == it2);
5252
assert(result);
5353

54-
++it2; ++it2;
54+
++it2;
55+
++it2;
5556
assert(!(it1 == it2));
5657
++it2;
5758
assert(*it1 == *it2);

libcxx/test/std/ranges/range.adaptors/range.concat/iterator/ctor.other.pass.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313

1414
#include "../../range_adaptor_types.h"
1515

16-
using ConstIterIncompatibleView = BasicView<forward_iterator<int*>, forward_iterator<int*>,
17-
random_access_iterator<const int*>, random_access_iterator<const int*>>;
16+
using ConstIterIncompatibleView =
17+
BasicView<forward_iterator<int*>,
18+
forward_iterator<int*>,
19+
random_access_iterator<const int*>,
20+
random_access_iterator<const int*>>;
1821
static_assert(!std::convertible_to<std::ranges::iterator_t<ConstIterIncompatibleView>,
1922
std::ranges::iterator_t<const ConstIterIncompatibleView>>);
2023

@@ -23,7 +26,7 @@ constexpr bool test() {
2326

2427
{
2528
std::ranges::concat_view v(NonSimpleCommon{buffer});
26-
auto iter1 = v.begin();
29+
auto iter1 = v.begin();
2730
std::ranges::iterator_t<const decltype(v)> iter2 = iter1;
2831
assert(iter1 == iter2);
2932

libcxx/test/std/ranges/range.adaptors/range.concat/iterator/deref.pass.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
template <class Iter, class ValueType = int, class Sent = sentinel_wrapper<Iter>>
1919
constexpr void test() {
20-
2120
{
2221
// test with one view
2322
using View = minimal_view<Iter, Sent>;
@@ -42,8 +41,8 @@ constexpr void test() {
4241
std::array<int, 3> array1{0, 1, 2};
4342
std::array<int, 3> array2{0, 1, 2};
4443
std::ranges::concat_view view(std::views::all(array1), std::views::all(array2));
45-
decltype(auto) it1 = view.begin();
46-
decltype(auto) it2 = view.begin() + 3;
44+
decltype(auto) it1 = view.begin();
45+
decltype(auto) it2 = view.begin() + 3;
4746

4847
ASSERT_SAME_TYPE(int&, decltype(*it1));
4948
assert(*it1 == *it2);
@@ -54,8 +53,8 @@ constexpr void test() {
5453
constexpr static std::array<int, 3> array1{0, 1, 2};
5554
constexpr static std::array<int, 3> array2{0, 1, 2};
5655
constexpr static std::ranges::concat_view view(std::views::all(array1), std::views::all(array2));
57-
decltype(auto) it1 = view.begin();
58-
decltype(auto) it2 = view.begin() + 3;
56+
decltype(auto) it1 = view.begin();
57+
decltype(auto) it2 = view.begin() + 3;
5958

6059
ASSERT_SAME_TYPE(const int&, decltype(*it1));
6160
assert(*it1 == *it2);

libcxx/test/std/ranges/range.adaptors/range.concat/iterator/iter_move.pass.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ struct ThrowingMove {
3636

3737
template <class Iterator, bool HasNoexceptIterMove>
3838
constexpr bool test() {
39-
using Sentinel = sentinel_wrapper<Iterator>;
40-
using View = minimal_view<Iterator, Sentinel>;
39+
using Sentinel = sentinel_wrapper<Iterator>;
40+
using View = minimal_view<Iterator, Sentinel>;
4141

4242
{
4343
std::array<int, 5> array1{0, 1, 2, 3, 4};
@@ -61,7 +61,6 @@ constexpr bool test() {
6161
static_assert(!noexcept(std::ranges::iter_move(it)));
6262
}
6363

64-
6564
return true;
6665
}
6766

libcxx/test/std/ranges/range.adaptors/range.concat/iterator/iter_swap.pass.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ concept has_iter_swap = requires(It it) { std::ranges::iter_swap(it, it); };
2424
struct ThrowingMove {
2525
ThrowingMove() = default;
2626
ThrowingMove(ThrowingMove&&) {}
27-
ThrowingMove& operator=(ThrowingMove&&){return *this;}
27+
ThrowingMove& operator=(ThrowingMove&&) { return *this; }
2828
};
2929

3030
template <class Iterator, bool IsNoexcept>
@@ -41,8 +41,8 @@ constexpr void test() {
4141
View v2{Iterator(array2.data()), Sentinel(Iterator(array2.data() + array2.size()))};
4242
std::ranges::concat_view view(std::move(v1), std::move(v2));
4343

44-
auto it1 = view.begin();
45-
auto it2 = ++view.begin();
44+
auto it1 = view.begin();
45+
auto it2 = ++view.begin();
4646

4747
static_assert(std::is_same_v<decltype(iter_swap(it1, it2)), void>);
4848
static_assert(noexcept(iter_swap(it1, it2)) == IsNoexcept);

0 commit comments

Comments
 (0)