diff options
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 799f310..69839ba 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -35864,6 +35864,7 @@ cp_parser_omp_clause_schedule (cp_parser *parser, tree list, location_t location c = build_omp_clause (location, OMP_CLAUSE_SCHEDULE); + location_t comma = UNKNOWN_LOCATION; while (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) { tree id = cp_lexer_peek_token (parser->lexer)->u.value; @@ -35876,16 +35877,22 @@ cp_parser_omp_clause_schedule (cp_parser *parser, tree list, location_t location modifiers |= OMP_CLAUSE_SCHEDULE_NONMONOTONIC; else break; + comma = UNKNOWN_LOCATION; cp_lexer_consume_token (parser->lexer); if (nmodifiers++ == 0 && cp_lexer_next_token_is (parser->lexer, CPP_COMMA)) - cp_lexer_consume_token (parser->lexer); + { + comma = cp_lexer_peek_token (parser->lexer)->location; + cp_lexer_consume_token (parser->lexer); + } else { cp_parser_require (parser, CPP_COLON, RT_COLON); break; } } + if (comma != UNKNOWN_LOCATION) + error_at (comma, "expected %<:%>"); if (cp_lexer_next_token_is (parser->lexer, CPP_NAME)) { |