aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/gomp/pr106124.C
blob: 3129749804bff07dc0b7f24c7c206f876af00a97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// { dg-do compile }
// { dg-require-effective-target c++11 }
// { dg-options "-g -O2 -fopenmp -fkeep-inline-functions" }

int q;
struct A
{
  typedef int T;
#pragma omp declare reduction (x : T : omp_out += omp_in + [] (){ return q; }()) initializer (omp_priv = [](){ return 0; }())
  static void foo ();
};
void bar (int &, int &);
void
A::foo ()
{
  int r = 0, s = 0;
#pragma omp parallel reduction (x : r, s)
  bar (r, s);
}