diff options
Diffstat (limited to 'test/OpenMP/declare_reduction_messages.cpp')
-rw-r--r-- | test/OpenMP/declare_reduction_messages.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/test/OpenMP/declare_reduction_messages.cpp b/test/OpenMP/declare_reduction_messages.cpp index f22f92485a..21c03fac22 100644 --- a/test/OpenMP/declare_reduction_messages.cpp +++ b/test/OpenMP/declare_reduction_messages.cpp @@ -142,17 +142,33 @@ int main() { #if __cplusplus == 201103L struct A { A() {} - // expected-note@+1 {{copy constructor is implicitly deleted because 'A' has a user-declared move assignment operator}} A& operator=(A&&) = default; }; int A_TEST() { A test; -// expected-error@+1 {{call to implicitly-deleted copy constructor of 'A'}} #pragma omp declare reduction(+ : A : omp_out) initializer(omp_priv = A()) -// expected-error@+1 {{invalid operands to binary expression ('A' and 'A')}} #pragma omp parallel reduction(+ : test) {} return 0; } + +struct U +{ + void foo(U&, bool); + U(); +}; +template <int N> +struct S +{ + int s; + // expected-note@+1 {{'foo' declared here}} + void foo(S &x) {}; + // expected-error@+1 {{too many arguments to function call, expected single argument 'x', have 2 arguments}} + #pragma omp declare reduction (foo : U, S : omp_out.foo(omp_in, false)) +}; +// expected-warning@+2 {{extra tokens at the end of '#pragma omp declare reduction' are ignored}} +// expected-note@+1 {{in instantiation of template class 'S<1>' requested here}} +#pragma omp declare reduction (bar : S<1> : omp_out.foo(omp_in)) + #endif |