1 // RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp -x c++ -std=c++14 -fms-extensions -Wno-pragma-pack -fexceptions -fcxx-exceptions %s
2 
3 // RUN: %clang_cc1 -triple=x86_64-pc-win32 -verify -fopenmp-simd -x c++ -std=c++14 -fms-extensions -Wno-pragma-pack -fexceptions -fcxx-exceptions %s
4 
5 // expected-error@+1 {{expected an OpenMP directive}}
6 #pragma omp declare
7 
8 int foo();
9 
10 template <typename T>
11 T foofoo(); // expected-note 2 {{declared here}}
12 
13 #pragma omp declare variant                                  // expected-error {{expected '(' after 'declare variant'}}
14 #pragma omp declare variant(                                 // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
15 #pragma omp declare variant(foo                              // expected-error {{expected ')'}} expected-error {{expected 'match' clause on 'omp declare variant' directive}} expected-note {{to match this '('}}
16 #pragma omp declare variant(x)                               // expected-error {{use of undeclared identifier 'x'}}
17 #pragma omp declare variant(foo)                             // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
18 #pragma omp declare variant(foofoo <int>)                    // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
19 #pragma omp declare variant(foofoo <int>) xxx                // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
20 #pragma omp declare variant(foofoo <int>) match              // expected-error {{expected '(' after 'match'}}
21 #pragma omp declare variant(foofoo <int>) match(             // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
22 #pragma omp declare variant(foofoo <int>) match()            // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
23 #pragma omp declare variant(foofoo <int>) match(xxx)         // expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}}
24 #pragma omp declare variant(foofoo <int>) match(xxx =)       // expected-error {{expected '{' after '='}}
25 #pragma omp declare variant(foofoo <int>) match(xxx = yyy)   // expected-error {{expected '{' after '='}}
26 #pragma omp declare variant(foofoo <int>) match(xxx = yyy }) // expected-error {{expected '{' after '='}}
27 #pragma omp declare variant(foofoo <int>) match(xxx = {)     // expected-error {{expected '}' or ',' after ')'}} expected-error {{expected '}'}} expected-note {{to match this '{'}}
28 #pragma omp declare variant(foofoo <int>) match(xxx = {})
29 #pragma omp declare variant(foofoo <int>) match(xxx = {vvv, vvv})
30 #pragma omp declare variant(foofoo <int>) match(xxx = {vvv} xxx) // expected-error {{expected ','}} expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}} expected-error {{context selector set 'xxx' is used already in the same 'omp declare variant' directive}} expected-note {{previously context selector set 'xxx' used here}}
31 #pragma omp declare variant(foofoo <int>) match(xxx = {vvv}) xxx // expected-warning {{extra tokens at the end of '#pragma omp declare variant' are ignored}}
32 #pragma omp declare variant(foofoo <int>) match(implementation={xxx}) // expected-warning {{unknown context selector in 'implementation' context selector set of 'omp declare variant' directive, ignored}}
33 #pragma omp declare variant(foofoo <int>) match(implementation={vendor}) // expected-error {{expected '(' after 'vendor'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
34 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(}) // expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
35 #pragma omp declare variant(foofoo <int>) match(implementation={vendor()}) // expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}}
36 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score ibm)}) // expected-error {{expected '(' after 'score'}} expected-warning {{missing ':' after context selector score clause - ignoring}}
37 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score( ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-error {{use of undeclared identifier 'ibm'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note {{to match this '('}}
38 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(2 ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error 2 {{expected ')'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note 2 {{to match this '('}}
39 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(foofoo <int>()) ibm)}) // expected-warning {{missing ':' after context selector score clause - ignoring}} expected-error {{expression is not an integral constant expression}} expected-note {{non-constexpr function 'foofoo<int>' cannot be used in a constant expression}}
40 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(5): ibm), vendor(llvm)}) // expected-error {{context trait selector 'vendor' is used already in the same 'implementation' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'vendor' used here}}
41 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(5): ibm), kind(cpu)}) // expected-warning {{unknown context selector in 'implementation' context selector set of 'omp declare variant' directive, ignored}}
42 #pragma omp declare variant(foofoo <int>) match(device={xxx}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}}
43 #pragma omp declare variant(foofoo <int>) match(device={kind}) // expected-error {{expected '(' after 'kind'}} expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error {{expected ')'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
44 #pragma omp declare variant(foofoo <int>) match(device={kind(}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error 2 {{expected ')'}} expected-note {{to match this '('}}
45 #pragma omp declare variant(foofoo <int>) match(device={kind()}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}}
46 #pragma omp declare variant(foofoo <int>) match(device={kind(score cpu)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
47 #pragma omp declare variant(foofoo <int>) match(device={kind(score( ibm)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
48 #pragma omp declare variant(foofoo <int>) match(device={kind(score(2 gpu)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
49 #pragma omp declare variant(foofoo <int>) match(device={kind(score(foofoo <int>()) ibm)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
50 #pragma omp declare variant(foofoo <int>) match(device={kind(score(5): host), kind(llvm)}) // expected-error {{context trait selector 'kind' is used already in the same 'device' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'kind' used here}} expected-error {{expected ')' or ',' after 'score'}} expected-note {{to match this '('}} expected-error {{expected ')'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}} expected-error {{unknown 'llvm' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
51 #pragma omp declare variant(foofoo <int>) match(device={kind(score(5): nohost), vendor(llvm)}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}} expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
52 int bar();
53 
54 #pragma omp declare variant                            // expected-error {{expected '(' after 'declare variant'}}
55 #pragma omp declare variant(                           // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
56 #pragma omp declare variant(foofoo <T>                 // expected-error {{expected ')'}} expected-error {{expected 'match' clause on 'omp declare variant' directive}} expected-note {{to match this '('}}
57 #pragma omp declare variant(x)                         // expected-error {{use of undeclared identifier 'x'}}
58 #pragma omp declare variant(foo)                       // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
59 #pragma omp declare variant(foofoo)                    // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
60 #pragma omp declare variant(foofoo <T>)                // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
61 #pragma omp declare variant(foofoo <T>) xxx            // expected-error {{expected 'match' clause on 'omp declare variant' directive}}
62 #pragma omp declare variant(foofoo <T>) match          // expected-error {{expected '(' after 'match'}}
63 #pragma omp declare variant(foofoo <T>) match(         // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
64 #pragma omp declare variant(foofoo <T>) match()        // expected-error {{expected context selector in 'match' clause on 'omp declare variant' directive}}
65 #pragma omp declare variant(foofoo <T>) match(xxx)     // expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}}
66 #pragma omp declare variant(foofoo <T>) match(xxx =)   // expected-error {{expected '{' after '='}}
67 #pragma omp declare variant(foofoo <T>) match(xxx = {) // expected-error {{expected '}' or ',' after ')'}} expected-error {{expected '}'}} expected-note {{to match this '{'}}
68 #pragma omp declare variant(foofoo <T>) match(xxx = {})
69 #pragma omp declare variant(foofoo <T>) match(xxx = {vvv, vvv})
70 #pragma omp declare variant(foofoo <T>) match(user = {score(<expr>) : condition(<expr>)})
71 #pragma omp declare variant(foofoo <T>) match(user = {score(<expr>) : condition(<expr>)})
72 #pragma omp declare variant(foofoo <T>) match(user = {condition(<expr>)})
73 #pragma omp declare variant(foofoo <T>) match(user = {condition(<expr>)})
74 #pragma omp declare variant(foofoo <T>) match(xxx = {vvv} xxx) // expected-error {{expected ','}} expected-error {{expected '=' after 'xxx' context selector set name on 'omp declare variant' directive}} expected-error {{context selector set 'xxx' is used already in the same 'omp declare variant' directive}} expected-note {{previously context selector set 'xxx' used here}}
75 #pragma omp declare variant(foofoo <T>) match(xxx = {vvv}) xxx // expected-warning {{extra tokens at the end of '#pragma omp declare variant' are ignored}}
76 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score ibm)}) // expected-error {{expected '(' after 'score'}} expected-warning {{missing ':' after context selector score clause - ignoring}}
77 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score( ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error {{expected ')'}} expected-error {{use of undeclared identifier 'ibm'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note {{to match this '('}}
78 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(C ibm)}) // expected-error {{expected ')' or ',' after 'vendor name'}} expected-error 2 {{expected ')'}} expected-error {{expected vendor identifier in 'vendor' context selector of 'implementation' selector set of 'omp declare variant' directive}} expected-warning {{missing ':' after context selector score clause - ignoring}} expected-note 2 {{to match this '('}}
79 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(foofoo <int>()) ibm)}) // expected-warning {{missing ':' after context selector score clause - ignoring}} expected-error {{expression is not an integral constant expression}} expected-note {{non-constexpr function 'foofoo<int>' cannot be used in a constant expression}}
80 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(C+5): ibm), vendor(llvm)}) // expected-error {{context trait selector 'vendor' is used already in the same 'implementation' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'vendor' used here}}
81 #pragma omp declare variant(foofoo <int>) match(implementation={vendor(score(5): ibm), kind(cpu)}) // expected-warning {{unknown context selector in 'implementation' context selector set of 'omp declare variant' directive, ignored}}
82 #pragma omp declare variant(foofoo <int>) match(device={xxx}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}}
83 #pragma omp declare variant(foofoo <int>) match(device={kind}) // expected-error {{expected '(' after 'kind'}} expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error {{expected ')'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
84 #pragma omp declare variant(foofoo <int>) match(device={kind(}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}} expected-error 2 {{expected ')'}} expected-note {{to match this '('}}
85 #pragma omp declare variant(foofoo <int>) match(device={kind()}) // expected-error {{expected 'host', 'nohost', 'cpu', 'gpu', or 'fpga' in 'kind' context selector of 'device' selector set of 'omp declare variant' directive}}
86 #pragma omp declare variant(foofoo <int>) match(device={kind(score cpu)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
87 #pragma omp declare variant(foofoo <int>) match(device={kind(score( ibm)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
88 #pragma omp declare variant(foofoo <int>) match(device={kind(score(C gpu)}) // expected-error 2 {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
89 #pragma omp declare variant(foofoo <int>) match(device={kind(score(foofoo <int>()) ibm)}) // expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
90 #pragma omp declare variant(foofoo <int>) match(device={kind(score(C+5): host), kind(llvm)}) // expected-error {{context trait selector 'kind' is used already in the same 'device' context selector set of 'omp declare variant' directive}} expected-note {{previously context trait selector 'kind' used here}} expected-error {{expected ')' or ',' after 'score'}} expected-note {{to match this '('}} expected-error {{expected ')'}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}} expected-error {{unknown 'llvm' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
91 #pragma omp declare variant(foofoo <int>) match(device={kind(score(C+5): nohost), vendor(llvm)}) // expected-warning {{unknown context selector in 'device' context selector set of 'omp declare variant' directive, ignored}} expected-error {{expected ')' or ',' after 'score'}} expected-error {{expected ')'}} expected-note {{to match this '('}} expected-error {{unknown 'score' device kind trait in the 'device' context selector set, expected one of 'host', 'nohost', 'cpu', 'gpu' or 'fpga'}}
92 template <typename T, int C>
93 T barbar();
94 
95 // expected-error@+2 {{'#pragma omp declare variant' can only be applied to functions}}
96 #pragma omp declare variant(barbar <int>) match(xxx = {})
97 int a;
98 // expected-error@+2 {{'#pragma omp declare variant' can only be applied to functions}}
99 #pragma omp declare variant(barbar <int>) match(xxx = {})
100 #pragma omp threadprivate(a)
101 int var;
102 #pragma omp threadprivate(var)
103 
104 // expected-error@+2 {{expected an OpenMP directive}} expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
105 #pragma omp declare variant(barbar <int>) match(xxx = {})
106 #pragma omp declare
107 
108 // expected-error@+3 {{function declaration is expected after 'declare variant' directive}}
109 // expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
110 #pragma omp declare variant(barbar <int>) match(xxx = {})
111 #pragma omp declare variant(barbar <int>) match(xxx = {})
112 #pragma options align = packed
113 int main();
114 
115 // expected-error@+3 {{function declaration is expected after 'declare variant' directive}}
116 // expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
117 #pragma omp declare variant(barbar <int>) match(xxx = {})
118 #pragma omp declare variant(barbar <int>) match(xxx = {})
119 #pragma init_seg(compiler)
120 int main();
121 
122 // expected-error@+1 {{single declaration is expected after 'declare variant' directive}}
123 #pragma omp declare variant(barbar <int>) match(xxx = {})
124 int b, c;
125 
126 // expected-error@+1 {{'C' does not refer to a value}}
127 #pragma omp declare variant(C) match(xxx = {})
128 // expected-note@+1 {{declared here}}
129 template <class C>
130 void h(C *hp, C *hp2, C *hq, C *lin) {
131   b = 0;
132 }
133 
134 // expected-error@+1 {{variant in '#pragma omp declare variant' with type '<overloaded function type>' is incompatible with type 'void (int *, int *, int *, int *)'}}
135 #pragma omp declare variant(barbar <int>) match(xxx = {})
136 template <>
137 void h(int *hp, int *hp2, int *hq, int *lin);
138 
139 int after_use_variant(void);
140 int after_use();
141 int bar() {
142   return after_use();
143 }
144 
145 // expected-warning@+1 {{'#pragma omp declare variant' cannot be applied for function after first usage; the original function might be used}}
146 #pragma omp declare variant(after_use_variant) match(xxx = {})
147 int after_use(void);
148 
149 int fn();
150 int fn(int);
151 #pragma omp declare variant(fn) match(xxx = {})
152 int overload(void);
153 
154 int fn1();
155 int fn1(int);
156 // expected-error@+1 {{variant in '#pragma omp declare variant' with type '<overloaded function type>' is incompatible with type 'int (float)'}}
157 #pragma omp declare variant(fn1) match(xxx = {})
158 int overload1(float);
159 
160 int fn_constexpr_variant();
161 // expected-error@+2 {{'#pragma omp declare variant' does not support constexpr functions}}
162 #pragma omp declare variant(fn_constexpr_variant) match(xxx = {})
163 constexpr int fn_constexpr();
164 
165 constexpr int fn_constexpr_variant1();
166 // expected-error@+1 {{'#pragma omp declare variant' does not support constexpr functions}}
167 #pragma omp declare variant(fn_constexpr_variant1) match(xxx = {})
168 int fn_constexpr1();
169 
170 int fn_sc_variant();
171 // expected-error@+1 {{function with '#pragma omp declare variant' has a different storage class}}
172 #pragma omp declare variant(fn_sc_variant) match(xxx = {})
173 static int fn_sc();
174 
175 static int fn_sc_variant1();
176 // expected-error@+1 {{function with '#pragma omp declare variant' has a different storage class}}
177 #pragma omp declare variant(fn_sc_variant1) match(xxx = {})
178 int fn_sc1();
179 
180 int fn_inline_variant();
181 // expected-error@+1 {{function with '#pragma omp declare variant' has a different inline specification}}
182 #pragma omp declare variant(fn_inline_variant) match(xxx = {})
183 inline int fn_inline();
184 
185 inline int fn_inline_variant1();
186 // expected-error@+1 {{function with '#pragma omp declare variant' has a different inline specification}}
187 #pragma omp declare variant(fn_inline_variant1) match(xxx = {})
188 int fn_inline1();
189 
190 auto fn_deduced_variant() { return 0; }
191 #pragma omp declare variant(fn_deduced_variant) match(xxx = {})
192 int fn_deduced();
193 
194 int fn_deduced_variant1();
195 #pragma omp declare variant(fn_deduced_variant1) match(xxx = {})
196 auto fn_deduced1() { return 0; }
197 
198 auto fn_deduced3() { return 0; }
199 // expected-warning@+1 {{'#pragma omp declare variant' cannot be applied to the function that was defined already; the original function might be used}}
200 #pragma omp declare variant(fn_deduced_variant1) match(xxx = {})
201 auto fn_deduced3();
202 
203 auto fn_deduced_variant2() { return 0; }
204 // expected-error@+1 {{variant in '#pragma omp declare variant' with type 'int ()' is incompatible with type 'float ()'}}
205 #pragma omp declare variant(fn_deduced_variant2) match(xxx = {})
206 float fn_deduced2();
207 
208 // expected-error@+1 {{exception specification in declaration does not match previous declaration}}
209 int fn_except_variant() noexcept(true);
210 // expected-note@+2 {{previous declaration is here}}
211 #pragma omp declare variant(fn_except_variant) match(xxx = {})
212 int fn_except() noexcept(false);
213 
214 // expected-error@+1 {{exception specification in declaration does not match previous declaration}}
215 int fn_except_variant1() noexcept(false);
216 // expected-note@+2 {{previous declaration is here}}
217 #pragma omp declare variant(fn_except_variant1) match(xxx = {})
218 int fn_except1() noexcept(true);
219 
220 struct SpecialFuncs {
221   void vd();
222   // expected-error@+2 {{'#pragma omp declare variant' does not support constructors}}
223 #pragma omp declare variant(SpecialFuncs::vd) match(xxx = {})
224   SpecialFuncs();
225   // expected-error@+2 {{'#pragma omp declare variant' does not support destructors}}
226 #pragma omp declare variant(SpecialFuncs::vd) match(xxx = {})
227   ~SpecialFuncs();
228 
229   void baz();
230   void bar();
231   void bar(int);
232 #pragma omp declare variant(SpecialFuncs::baz) match(xxx = {})
233 #pragma omp declare variant(SpecialFuncs::bar) match(xxx = {})
234 // expected-error@+1 {{variant in '#pragma omp declare variant' with type 'int (*)()' is incompatible with type 'void (SpecialFuncs::*)()'}}
235 #pragma omp declare variant(fn_sc_variant1) match(xxx = {})
236   void foo1();
237   SpecialFuncs& foo(const SpecialFuncs&);
238   SpecialFuncs& bar(SpecialFuncs&&);
239   // expected-error@+2 {{'#pragma omp declare variant' does not support defaulted functions}}
240 #pragma omp declare variant(SpecialFuncs::foo) match(xxx = {})
241   SpecialFuncs& operator=(const SpecialFuncs&) = default;
242   // expected-error@+2 {{'#pragma omp declare variant' does not support deleted functions}}
243 #pragma omp declare variant(SpecialFuncs::bar) match(xxx = {})
244   SpecialFuncs& operator=(SpecialFuncs&&) = delete;
245 };
246 
247 namespace N {
248 // expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
249 #pragma omp declare variant
250 } // namespace N
251 // expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
252 #pragma omp declare variant
253 // expected-error@+1 {{function declaration is expected after 'declare variant' directive}}
254 #pragma omp declare variant
255