1 // RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit 100 -o - %s
2 
foo()3 void foo() {
4 }
5 
foobool(int argc)6 bool foobool(int argc) {
7   return argc;
8 }
9 
10 struct S1; // expected-note {{declared here}}
11 class S2 {
12   mutable int a;
13 public:
S2()14   S2():a(0) { }
operator =(S2 & s2)15   S2 & operator =(S2 &s2) { return *this; }
16 };
17 class S3 {
18   int a;
19 public:
S3()20   S3():a(0) { }
operator =(S3 & s3)21   S3 &operator =(S3 &s3) { return *this; }
22 };
23 class S4 { // expected-note {{'S4' declared here}}
24   int a;
25   S4();
26   S4 &operator =(const S4 &s4);
27 public:
S4(int v)28   S4(int v):a(v) { }
29 };
30 class S5 { // expected-note {{'S5' declared here}}
31   int a;
S5()32   S5():a(0) {}
operator =(const S5 & s5)33   S5 &operator =(const S5 &s5) { return *this; }
34 public:
S5(int v)35   S5(int v):a(v) { }
36 };
37 template <class T>
38 class ST {
39 public:
40   static T s;
41 };
42 
43 
44 S2 k;
45 S3 h;
46 S4 l(3); // expected-note {{'l' defined here}}
47 S5 m(4); // expected-note {{'m' defined here}}
48 #pragma omp threadprivate(h, k, l, m)
49 
main(int argc,char ** argv)50 int main(int argc, char **argv) {
51   int i;
52   #pragma omp parallel copyin // expected-error {{expected '(' after 'copyin'}}
53   #pragma omp parallel copyin ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
54   #pragma omp parallel copyin () // expected-error {{expected expression}}
55   #pragma omp parallel copyin (k // expected-error {{expected ')'}} expected-note {{to match this '('}}
56   #pragma omp parallel copyin (h, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
57   #pragma omp parallel copyin (argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
58   #pragma omp parallel copyin (l) // expected-error {{copyin variable must have an accessible, unambiguous copy assignment operator}}
59   #pragma omp parallel copyin (S1) // expected-error {{'S1' does not refer to a value}}
60   #pragma omp parallel copyin (argv[1]) // expected-error {{expected variable name}}
61   #pragma omp parallel copyin(i) // expected-error {{copyin variable must be threadprivate}}
62   #pragma omp parallel copyin(m) // expected-error {{copyin variable must have an accessible, unambiguous copy assignment operator}}
63   #pragma omp parallel copyin(ST<int>::s) // expected-error {{copyin variable must be threadprivate}}
64   foo();
65 
66   return 0;
67 }
68