view gcc/testsuite/g++.dg/gomp/reference-1.C @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

// { dg-do compile }

struct S;	// { dg-message "forward declaration" }
void foo (S &);

void
f1 (S &x)	// { dg-error "has incomplete type" }
{
#pragma omp parallel private (x)
  foo (x);
}

void
f2 (S &x)	// { dg-error "has incomplete type" }
{
#pragma omp parallel firstprivate (x)
  foo (x);
}

void
f3 (S &x)	// { dg-error "has incomplete type" }
{
#pragma omp parallel for lastprivate (x)
  for (int i = 0; i < 10; i++)
    foo (x);
}