summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/pr35364.C
blob: da60d5debfcaae28c7cb4fcb5d25dc8fd1367546 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// PR target/35364
// { dg-do compile }
// { dg-options "-O2 -fopenmp" }

template <typename T>
struct E
{
  E ();
  ~E ();
};

template <typename T, typename U>
struct C
{
  C (const U &y) : u (y) {}
  ~C () {}
  const U &u;
};

template <typename T, typename U = E<T> >
struct B : public C<T, U>
{
  B (int x, const T &z = T (), const U &y = U ()) : C<T, U> (y) {}
  ~B () {}
};

void
foo ()
{
#pragma omp parallel
  {
    B<double> x (1);
  }
#pragma omp for
  for (int i = 0; i < 10; i++)
    {
      B<int> x (i);
    }
#pragma omp sections
  {
#pragma omp section
    {
      B<int> x (6);
    }
  }
#pragma omp single
  {
    B<int> x (16);
  }
}