summaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c')
-rw-r--r--gcc/c/ChangeLog4
-rw-r--r--gcc/c/c-parser.c19
2 files changed, 13 insertions, 10 deletions
diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog
index 9bb5ec1dfce..3d69cd57949 100644
--- a/gcc/c/ChangeLog
+++ b/gcc/c/ChangeLog
@@ -1,3 +1,7 @@
+2016-05-24 Thomas Schwinge <thomas@codesourcery.com>
+
+ * c-parser.c (c_parser_oacc_routine): Tighten syntax checks.
+
2016-05-24 Richard Biener <rguenther@suse.de>
PR middle-end/70434
diff --git a/gcc/c/c-parser.c b/gcc/c/c-parser.c
index c2c83143c05..1bc5eed7f55 100644
--- a/gcc/c/c-parser.c
+++ b/gcc/c/c-parser.c
@@ -13983,25 +13983,24 @@ c_parser_oacc_routine (c_parser *parser, enum pragma_context context)
c_parser_consume_token (parser);
c_token *token = c_parser_peek_token (parser);
-
if (token->type == CPP_NAME && (token->id_kind == C_ID_ID
|| token->id_kind == C_ID_TYPENAME))
{
decl = lookup_name (token->value);
if (!decl)
- {
- error_at (token->location, "%qE has not been declared",
- token->value);
- decl = error_mark_node;
- }
+ error_at (token->location, "%qE has not been declared",
+ token->value);
+ c_parser_consume_token (parser);
}
else
c_parser_error (parser, "expected function name");
- if (token->type != CPP_CLOSE_PAREN)
- c_parser_consume_token (parser);
-
- c_parser_skip_until_found (parser, CPP_CLOSE_PAREN, 0);
+ if (!decl
+ || !c_parser_require (parser, CPP_CLOSE_PAREN, "expected %<)%>"))
+ {
+ c_parser_skip_to_pragma_eol (parser, false);
+ return;
+ }
}
/* Build a chain of clauses. */