gcc/testsuite/g++.dg/parse/pr96257.C
raw| 1 | // PR96257 we scan forwards checking for a compound literal. Do not |
| 2 | // eat the tokens when doing that! |
| 3 | /* { dg-require-effective-target fopenmp } */ |
| 4 | /* { dg-additional-options -fopenmp } */ |
| 5 | |
| 6 | int |
| 7 | f2 () |
| 8 | { |
| 9 | int s = (int // { dg-error "expected" } |
| 10 | #pragma omp atomic capture |
| 11 | ){1}; |
| 12 | |
| 13 | int t = (int // { dg-error "expected" } |
| 14 | #pragma omp atomic capture ){ |
| 15 | {1}; |
| 16 | |
| 17 | return s + t; |
| 18 | } // { dg-bogus "expected" } |