1// RUN: %clang_cc1 -verify -fopenmp=libiomp5 -ferror-limit 100 -o - %s 2 3void foo() { 4} 5 6bool foobool(int argc) { 7 return argc; 8} 9 10struct S1; // expected-note {{declared here}} 11class S2 { 12 mutable int a; 13public: 14 S2():a(0) { } 15 S2 & operator =(S2 &s2) { return *this; } 16}; 17class S3 { 18 int a; 19public: 20 S3():a(0) { } 21 S3 &operator =(S3 &s3) { return *this; } 22}; 23class S4 { // expected-note {{'S4' declared here}} 24 int a; 25 S4(); 26 S4 &operator =(const S4 &s4); 27public: 28 S4(int v):a(v) { } 29}; 30class S5 { // expected-note {{'S5' declared here}} 31 int a; 32 S5():a(0) {} 33 S5 &operator =(const S5 &s5) { return *this; } 34public: 35 S5(int v):a(v) { } 36}; 37template <class T> 38class ST { 39public: 40 static T s; 41}; 42 43 44S2 k; 45S3 h; 46S4 l(3); // expected-note {{'l' defined here}} 47S5 m(4); // expected-note {{'m' defined here}} 48#pragma omp threadprivate(h, k, l, m) 49 50int 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