1 // { dg-do compile }
2
3 struct A { int a; };
4 struct B { B(); };
5 struct C { C(); C(const C&); };
6 struct D { D& operator=(const D&); };
7
8 class E { private: E(); public: E(int); }; // { dg-message "private" }
9 class F { private: F(const F&); public: F(); }; // { dg-message "private" }
10 class G { private: G& operator=(const G&); }; // { dg-message "private" }
11
12 void bar();
foo()13 void foo()
14 {
15 A a; B b; C c; D d; E e(0); F f; G g;
16
17 #pragma omp parallel shared(a, b, c, d, e, f, g)
18 bar();
19
20 #pragma omp parallel private(a, b, c, d, f, g)
21 bar();
22 #pragma omp parallel private(e) // { dg-error "context" }
23 bar();
24
25 #pragma omp parallel firstprivate(a, b, c, d, e, g)
26 bar();
27 #pragma omp parallel firstprivate(f) // { dg-error "context" }
28 bar();
29
30 #pragma omp parallel sections lastprivate(a, b, d, c, f)
31 { bar(); }
32 #pragma omp parallel sections lastprivate(e) // { dg-error "context" }
33 { bar(); }
34 #pragma omp parallel sections lastprivate(g) // { dg-error "context" }
35 { bar(); }
36 #pragma omp parallel sections firstprivate(e) lastprivate(e)
37 { bar(); }
38 }
39