summaryrefslogtreecommitdiff
path: root/gcc/c-parser.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-17 14:16:42 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2007-12-17 14:16:42 +0000
commit77c8bed2a03447272cb01064921d613c31c51e7f (patch)
tree0c1892c61bffadc9f08eb2066cb7ca1d4438cae2 /gcc/c-parser.c
parentd286bc1a6d7cb6d758bbb94f8635c3d1361586e4 (diff)
downloadgcc-77c8bed2a03447272cb01064921d613c31c51e7f.tar.gz
PR c/34506
* c-parser.c (c_parser_omp_all_clauses): Accept optional comma in between clauses. * parser.c (cp_parser_omp_all_clauses): Accept optional comma in between clauses. * gcc.dg/gomp/clause-2.c: New test. * g++.dg/gomp/clause-4.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131008 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r--gcc/c-parser.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c
index c2e5435af26..107b114d469 100644
--- a/gcc/c-parser.c
+++ b/gcc/c-parser.c
@@ -7262,14 +7262,22 @@ c_parser_omp_all_clauses (c_parser *parser, unsigned int mask,
const char *where)
{
tree clauses = NULL;
+ bool first = true;
while (c_parser_next_token_is_not (parser, CPP_PRAGMA_EOL))
{
- location_t here = c_parser_peek_token (parser)->location;
- const pragma_omp_clause c_kind = c_parser_omp_clause_name (parser);
+ location_t here;
+ pragma_omp_clause c_kind;
const char *c_name;
tree prev = clauses;
+ if (!first && c_parser_next_token_is (parser, CPP_COMMA))
+ c_parser_consume_token (parser);
+
+ first = false;
+ here = c_parser_peek_token (parser)->location;
+ c_kind = c_parser_omp_clause_name (parser);
+
switch (c_kind)
{
case PRAGMA_OMP_CLAUSE_COPYIN: