+2018-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88258
+ * parser.c (cp_parser_skip_to_closing_parenthesis_1,
+ cp_parser_skip_to_end_of_statement,
+ cp_parser_skip_to_end_of_block_or_statement,
+ cp_parser_skip_to_closing_brace,
+ cp_parser_skip_to_closing_square_bracket,
+ cp_parser_skip_balanced_tokens): Don't treat CPP_PRAGMA_EOL specially
+ if in_pragma is false.
+
2018-12-01 Marek Polacek <polacek@redhat.com>
Implement P0634R3, Down with typename!
switch (token->type)
{
- case CPP_EOF:
case CPP_PRAGMA_EOL:
+ if (!parser->lexer->in_pragma)
+ break;
+ /* FALLTHRU */
+ case CPP_EOF:
/* If we've run out of tokens, then there is no closing `)'. */
return 0;
switch (token->type)
{
- case CPP_EOF:
case CPP_PRAGMA_EOL:
+ if (!parser->lexer->in_pragma)
+ break;
+ /* FALLTHRU */
+ case CPP_EOF:
/* If we've run out of tokens, stop. */
return;
switch (token->type)
{
- case CPP_EOF:
case CPP_PRAGMA_EOL:
+ if (!parser->lexer->in_pragma)
+ break;
+ /* FALLTHRU */
+ case CPP_EOF:
/* If we've run out of tokens, stop. */
return;
switch (token->type)
{
- case CPP_EOF:
case CPP_PRAGMA_EOL:
+ if (!parser->lexer->in_pragma)
+ break;
+ /* FALLTHRU */
+ case CPP_EOF:
/* If we've run out of tokens, stop. */
return false;
switch (token->type)
{
- case CPP_EOF:
case CPP_PRAGMA_EOL:
+ if (!parser->lexer->in_pragma)
+ break;
+ /* FALLTHRU */
+ case CPP_EOF:
/* If we've run out of tokens, then there is no closing `]'. */
return false;
do
switch (cp_lexer_peek_nth_token (parser->lexer, n++)->type)
{
- case CPP_EOF:
case CPP_PRAGMA_EOL:
+ if (!parser->lexer->in_pragma)
+ break;
+ /* FALLTHRU */
+ case CPP_EOF:
/* Ran out of tokens. */
return orig_n;
case CPP_OPEN_PAREN:
+2018-12-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/88258
+ * g++.dg/gomp/pr88258.C: New test.
+
2018-12-01 Marek Polacek <polacek@redhat.com>
Implement P0634R3, Down with typename!
--- /dev/null
+// PR c++/88258
+// { dg-do compile }
+// { dg-options "-fopenmp" }
+
+void
+foo (bar int p) // { dg-error "variable or field|was not declared in this scope" }
+{
+ int i, x;
+ #pragma omp atomic write
+ x = 6;
+}