Debian Codegraph @

gcc/testsuite/g++.dg/gomp/declare-variant-10.C

raw
1 // { dg-do compile }
2
3 #pragma omp declare variant (f1) match(user={condition(1)}) // { dg-error "'f1' was not declared in this scope; did you mean 'f2'\\\?" }
4 void
5 f2 (int)
6 {
7 }
8
9 void f3 (int);
10
11 #pragma omp declare variant (f3) match(user={condition(1)}) // { dg-error "variant 'void f3\\\(int\\\)' and base 'void f4\\\(long int\\\)' have incompatible types" }
12 void
13 f4 (long)
14 {
15 }
16
17 #pragma omp declare variant (f5) match(user={condition(1)}) // { dg-error "there are no arguments to 'f5' that depend on a template parameter, so a declaration of 'f5' must be available" }
18 template <int N>
19 void
20 f6 (int)
21 {
22 }
23
24 template <int N>
25 void f7 (int);
26
27 #pragma omp declare variant (f7) match(user={condition(1)}) // { dg-error "no matching function for call to 'f7\\\(long int\\\)'" }
28 template <int N>
29 void
30 f8 (long)
31 {
32 }
33
34 #pragma omp declare variant (f9) match(user={condition(1)})
35 template <typename T>
36 void
37 f10 (T) // { dg-error "'f9' was not declared in this scope; did you mean 'f8'\\\?" }
38 {
39 }
40
41 template <typename T>
42 void f11 (T, int);
43
44 #pragma omp declare variant (f11) match(user={condition(1)}) // { dg-error "variant 'void f11\\\(T, int\\\) \\\[with T = int\\\]' and base 'void f12\\\(T, long int\\\) \\\[with T = int\\\]' have incompatible types" }
45 template <typename T>
46 void
47 f12 (T, long)
48 {
49 }
50
51 void
52 test ()
53 {
54 f10 (0); // { dg-error "no matching function for call to 'f10\\\(int\\\)'" }
55 f12 (0, 0L);
56 }