Debian Codegraph @

libgomp/testsuite/libgomp.c++/pr88988.C

raw
1 // PR c++/88988
2 // { dg-do compile }
3 // { dg-additional-options "-std=c++14" }
4
5 extern "C" void abort ();
6
7 template <typename T>
8 struct A {
9 A () : a(), b()
10 {
11 [&] ()
12 {
13 #pragma omp task firstprivate (a) shared (b)
14 b = ++a;
15 #pragma omp taskwait
16 } ();
17 }
18
19 T a, b;
20 };
21
22 int
23 main ()
24 {
25 A<int> x;
26 if (x.a != 0 || x.b != 1)
27 abort ();
28 }