Commit 25f05e7b by Paolo Carlini Committed by Paolo Carlini

re PR c++/52987 (bogus expected ; before for undeclared type)

/cp
2015-07-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/52987
	* parser.c (cp_parser_simple_declaration): Robustify check avoiding
	redundant error messages.

/testsuite
2015-07-23  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/52987
	* g++.dg/parse/error57.C: New.
	* g++.dg/expr/string-2.C: Update.

From-SVN: r226097
parent 7bed1d3d
2015-07-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52987
* parser.c (cp_parser_simple_declaration): Robustify check avoiding
redundant error messages.
2015-07-21 Paolo Carlini <paolo.carlini@oracle.com> 2015-07-21 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): For an erroneous template parameter * decl.c (grokdeclarator): For an erroneous template parameter
......
...@@ -11660,7 +11660,8 @@ cp_parser_simple_declaration (cp_parser* parser, ...@@ -11660,7 +11660,8 @@ cp_parser_simple_declaration (cp_parser* parser,
{ {
/* If we have already issued an error message we don't need /* If we have already issued an error message we don't need
to issue another one. */ to issue another one. */
if (decl != error_mark_node if ((decl != error_mark_node
&& DECL_INITIAL (decl) != error_mark_node)
|| cp_parser_uncommitted_to_tentative_parse_p (parser)) || cp_parser_uncommitted_to_tentative_parse_p (parser))
cp_parser_error (parser, "expected %<,%> or %<;%>"); cp_parser_error (parser, "expected %<,%> or %<;%>");
/* Skip tokens until we reach the end of the statement. */ /* Skip tokens until we reach the end of the statement. */
......
2015-07-23 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52987
* g++.dg/parse/error57.C: New.
* g++.dg/expr/string-2.C: Update.
2015-07-23 Richard Biener <rguenther@suse.de> 2015-07-23 Richard Biener <rguenther@suse.de>
PR tree-optimization/66945 PR tree-optimization/66945
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
char a[1]; char a[1];
int foo(a = "") // { dg-error "invalid array assignment" } int foo(a = "") // { dg-error "invalid array assignment" }
{ // { dg-error "" } {
return 0; return 0;
} }
// PR c++/52987
int foo(x a) { // { dg-error "9:'x' was not declared in this scope" }
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment