diff options
author | Jakub Jelinek <jakub@redhat.com> | 2025-01-25 10:28:23 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2025-01-25 10:29:50 +0100 |
commit | 7eac20b0dde8df303557b6dd550d06ee98836c3c (patch) | |
tree | 40f2b05cf5f0c4b29d1c8f114b9439b495ababcc /gcc/testsuite/c-c++-common/gomp | |
parent | ce268ca2a923f8f35cc9dd5a7d0468a3980f129f (diff) | |
download | gcc-7eac20b0dde8df303557b6dd550d06ee98836c3c.zip gcc-7eac20b0dde8df303557b6dd550d06ee98836c3c.tar.gz gcc-7eac20b0dde8df303557b6dd550d06ee98836c3c.tar.bz2 |
c: Diagnose ,) at the end of OpenMP clauses [PR118639]
This is something the C++ FE has been diagnosing but C FE only
complained if there wasn't an identifier right after opening (
2025-01-25 Jakub Jelinek <jakub@redhat.com>
PR c/118639
* c-parser.cc (c_parser_omp_variable_list): Remove first variable
and emit "expected identifier" error regardless of it.
* c-c++-common/gomp/pr118639.c: New test.
* c-c++-common/goacc/cache-2.c: Remove one xfail for c.
Diffstat (limited to 'gcc/testsuite/c-c++-common/gomp')
-rw-r--r-- | gcc/testsuite/c-c++-common/gomp/pr118639.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/gomp/pr118639.c b/gcc/testsuite/c-c++-common/gomp/pr118639.c new file mode 100644 index 0000000..eba4b75 --- /dev/null +++ b/gcc/testsuite/c-c++-common/gomp/pr118639.c @@ -0,0 +1,14 @@ +/* PR c/118639 */ +/* { dg-do compile } */ + +void +foo (void) +{ + int a = 0, b = 0, c = 0; +#ifndef __cplusplus + #pragma omp allocate (a, ) /* { dg-error "expected" "" { target c } } */ +#endif + #pragma omp flush (b, ) /* { dg-error "expected" } */ + #pragma omp parallel firstprivate (c, ) /* { dg-error "expected" } */ + ; +} |