• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // -*- C++ -*-
2 //===-- scan.fail.cpp -----------------------------------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // UNSUPPORTED: c++03, c++11, c++14
11 
12 #include <execution>
13 #include <numeric>
14 
15 struct CustomPolicy
16 {
17     constexpr std::false_type
__allow_vectorCustomPolicy18     __allow_vector()
19     {
20         return std::false_type{};
21     }
22     constexpr std::false_type
__allow_parallelCustomPolicy23     __allow_parallel()
24     {
25         return std::false_type{};
26     }
27 } policy;
28 
29 int32_t
main()30 main()
31 {
32     int *first = nullptr, *last = nullptr, *result = nullptr;
33 
34     std::exclusive_scan(policy, first, last, result, 0); // expected-error {{no matching function for call to 'exclusive_scan'}}
35     std::exclusive_scan(policy, first, last, result, 0, std::plus<int>()); // expected-error {{no matching function for call to 'exclusive_scan'}}
36 
37     return 0;
38 }
39