Debian Codegraph @

clang/test/SemaOpenACC/compute-construct-if-clause.cpp

raw
1 // RUN: %clang_cc1 %s -fopenacc -verify
2
3 struct NoBoolConversion{};
4 struct BoolConversion{
5 operator bool();
6 };
7
8 template <typename T, typename U>
9 void BoolExpr() {
10
11 // expected-error@+1{{value of type 'NoBoolConversion' is not contextually convertible to 'bool'}}
12 #pragma acc parallel if (NoBoolConversion{})
13 while(0);
14
15 // expected-error@+2{{no member named 'NotValid' in 'NoBoolConversion'}}
16 // expected-note@#INST{{in instantiation of function template specialization}}
17 #pragma acc parallel if (T::NotValid)
18 while(0);
19
20 #pragma acc parallel if (BoolConversion{})
21 while(0);
22
23 // expected-error@+1{{value of type 'NoBoolConversion' is not contextually convertible to 'bool'}}
24 #pragma acc parallel if (T{})
25 while(0);
26
27 #pragma acc parallel if (U{})
28 while(0);
29 }
30
31 void Instantiate() {
32 BoolExpr<NoBoolConversion, BoolConversion>(); // #INST
33 }