gcc/testsuite/g++.dg/gomp/reference-1.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | struct S; // { dg-message "forward declaration" } |
| 4 | void foo (S &); |
| 5 | |
| 6 | void |
| 7 | f1 (S &x) // { dg-error "has incomplete type" } |
| 8 | { |
| 9 | #pragma omp parallel private (x) |
| 10 | foo (x); |
| 11 | } |
| 12 | |
| 13 | void |
| 14 | f2 (S &x) // { dg-error "has incomplete type" } |
| 15 | { |
| 16 | #pragma omp parallel firstprivate (x) |
| 17 | foo (x); |
| 18 | } |
| 19 | |
| 20 | void |
| 21 | f3 (S &x) // { dg-error "has incomplete type" } |
| 22 | { |
| 23 | #pragma omp parallel for lastprivate (x) |
| 24 | for (int i = 0; i < 10; i++) |
| 25 | foo (x); |
| 26 | } |