aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/pr88988.C
blob: 9dea35d15fe0c014b283655704833d4d817dc481 (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
// PR c++/88988
// { dg-do compile }
// { dg-additional-options "-std=c++14" }

extern "C" void abort ();

template <typename T>
struct A {
  A () : a(), b()
  {
    [&] ()
    {
#pragma omp task firstprivate (a) shared (b)
      b = ++a;
#pragma omp taskwait
    } ();
  }

  T a, b;
};

int
main ()
{
  A<int> x;
  if (x.a != 0 || x.b != 1)
    abort ();
}