c = build_omp_clause (loc, OMP_CLAUSE_SCHEDULE);
+ location_t comma = UNKNOWN_LOCATION;
while (c_parser_next_token_is (parser, CPP_NAME))
{
tree kind = c_parser_peek_token (parser)->value;
modifiers |= OMP_CLAUSE_SCHEDULE_NONMONOTONIC;
else
break;
+ comma = UNKNOWN_LOCATION;
c_parser_consume_token (parser);
if (nmodifiers++ == 0
&& c_parser_next_token_is (parser, CPP_COMMA))
- c_parser_consume_token (parser);
+ {
+ comma = c_parser_peek_token (parser)->location;
+ c_parser_consume_token (parser);
+ }
else
{
c_parser_require (parser, CPP_COLON, "expected %<:%>");
break;
}
}
+ if (comma != UNKNOWN_LOCATION)
+ error_at (comma, "expected %<:%>");
if ((modifiers & (OMP_CLAUSE_SCHEDULE_MONOTONIC
| OMP_CLAUSE_SCHEDULE_NONMONOTONIC))
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;
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))
{
--- /dev/null
+void
+foo (void)
+{
+ int i = 0;
+ #pragma omp for simd schedule(simd, static) /* { dg-error "expected ':'" } */
+ for (i = 0; i < 16; i++)
+ ;
+ #pragma omp for simd schedule(monotonic, dynamic) /* { dg-error "expected ':'" } */
+ for (i = 0; i < 16; i++)
+ ;
+ #pragma omp for simd schedule(nonmonotonic, guided, 1) /* { dg-error "expected ':'" } */
+ for (i = 0; i < 16; i++)
+ ;
+}