Debian Codegraph @

gcc/testsuite/g++.dg/gomp/pr35364.C

raw
1 // PR target/35364
2 // { dg-do compile }
3 // { dg-options "-O2 -fopenmp" }
4
5 template <typename T>
6 struct E
7 {
8 E ();
9 ~E ();
10 };
11
12 template <typename T, typename U>
13 struct C
14 {
15 C (const U &y) : u (y) {}
16 ~C () {}
17 const U &u;
18 };
19
20 template <typename T, typename U = E<T> >
21 struct B : public C<T, U>
22 {
23 B (int x, const T &z = T (), const U &y = U ()) : C<T, U> (y) {}
24 ~B () {}
25 };
26
27 void
28 foo ()
29 {
30 #pragma omp parallel
31 {
32 B<double> x (1);
33 }
34 #pragma omp for
35 for (int i = 0; i < 10; i++)
36 {
37 B<int> x (i);
38 }
39 #pragma omp sections
40 {
41 #pragma omp section
42 {
43 B<int> x (6);
44 }
45 }
46 #pragma omp single
47 {
48 B<int> x (16);
49 }
50 }