8b5865104c
PR c++/81314 * cp-gimplify.c (omp_var_to_track): Look through references. (omp_cxx_notice_variable): Likewise. * testsuite/libgomp.c++/pr81314.C: New test. From-SVN: r252770
39 lines
391 B
C
39 lines
391 B
C
// PR c++/81314
|
|
// { dg-do link }
|
|
|
|
template <int N>
|
|
struct S {
|
|
S () { s = 0; }
|
|
S (const S &x) { s = x.s; }
|
|
~S () {}
|
|
int s;
|
|
};
|
|
|
|
void
|
|
foo (S<2> &x)
|
|
{
|
|
#pragma omp taskloop
|
|
for (int i = 0; i < 100; ++i)
|
|
x.s++;
|
|
}
|
|
|
|
void
|
|
bar (S<3> &x)
|
|
{
|
|
#pragma omp task
|
|
x.s++;
|
|
}
|
|
|
|
int
|
|
main ()
|
|
{
|
|
S<2> s;
|
|
S<3> t;
|
|
#pragma omp parallel
|
|
#pragma omp master
|
|
{
|
|
foo (s);
|
|
bar (t);
|
|
}
|
|
}
|