Skip to content

Commit 2da3541

Browse files
Modify general test coverage for ranges algorithms
1 parent abf6df7 commit 2da3541

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

libcxx/test/libcxx/diagnostics/algorithm.nodiscard.verify.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,13 +388,17 @@ void test() {
388388
// expected-warning@-1{{ignoring return value of function declared with 'nodiscard' attribute}}
389389
std::ranges::fold_left(iter, iter, 0, std::plus());
390390
// expected-warning@-1{{ignoring return value of function declared with 'nodiscard' attribute}}
391-
std::ranges::fold_left_with_iter(range, 0, std::plus());
391+
std::ranges::fold_left_first(range, std::plus());
392392
// expected-warning@-1{{ignoring return value of function declared with 'nodiscard' attribute}}
393-
std::ranges::fold_left_with_iter(iter, iter, 0, std::plus());
393+
std::ranges::fold_left_first(iter, iter, std::plus());
394394
// expected-warning@-1{{ignoring return value of function declared with 'nodiscard' attribute}}
395395
std::ranges::fold_left_first_with_iter(range, std::plus());
396396
// expected-warning@-1{{ignoring return value of function declared with 'nodiscard' attribute}}
397397
std::ranges::fold_left_first_with_iter(iter, iter, std::plus());
398398
// expected-warning@-1{{ignoring return value of function declared with 'nodiscard' attribute}}
399+
std::ranges::fold_left_with_iter(range, 0, std::plus());
400+
// expected-warning@-1{{ignoring return value of function declared with 'nodiscard' attribute}}
401+
std::ranges::fold_left_with_iter(iter, iter, 0, std::plus());
402+
// expected-warning@-1{{ignoring return value of function declared with 'nodiscard' attribute}}
399403
#endif
400404
}

libcxx/test/std/library/description/conventions/customization.point.object/niebloid.compile.pass.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ static_assert(test(std::ranges::find_last, a, 42));
9494
static_assert(test(std::ranges::find_last_if, a, odd));
9595
static_assert(test(std::ranges::find_last_if_not, a, odd));
9696
static_assert(test(std::ranges::fold_left, a, 0, std::plus()));
97+
static_assert(test(std::ranges::fold_left_first(a, std::plus())));
98+
static_assert(test(std::ranges::fold_left_first_with_iter(a, std::plus())));
9799
static_assert(test(std::ranges::fold_left_with_iter, a, 0, std::plus()));
98100
#endif
99101
static_assert(test(std::ranges::for_each, a, odd));

0 commit comments

Comments
 (0)