1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // Check that PSTL algorithms are marked [[nodiscard]] as a conforming extension
10
11 // UNSUPPORTED: libcpp-has-no-incomplete-pstl
12
13 // UNSUPPORTED: c++03, c++11, c++14
14
15 #include <algorithm>
16 #include <execution>
17 #include <iterator>
18
test()19 void test() {
20 int a[] = {1};
21 auto pred = [](auto) { return false; };
22 std::all_of(std::execution::par, std::begin(a), std::end(a), pred); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
23 std::any_of(std::execution::par, std::begin(a), std::end(a), pred); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
24 std::none_of(std::execution::par, std::begin(a), std::end(a), pred); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
25 }
26