aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/pr82835.C
blob: df64ecfb1cf1feb61889c761ea7a3e7e84245e14 (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
// PR c++/82835
// { dg-do run }

int a, b;

template <class>
struct C {
  C (int x = a) : c (5) { if (x != 137) __builtin_abort (); }
  int c;
};

struct D {
  void foo ();
  int d;
};

void
D::foo ()
{
  C<int> c;
#pragma omp for private (c)
  for (b = 0; b < d; b++)
    c.c++;
}

int
main ()
{
  a = 137;
  D d;
  d.d = 16;
  d.foo ();
  return 0;
}