Retro68/gcc/libgomp/testsuite/libgomp.c++/pr88988.C
Wolfgang Thaller 6fbf4226da gcc-9.1
2019-06-20 20:10:10 +02:00

29 lines
359 B
C

// 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 ();
}