aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2015-07-23 10:11:48 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2015-07-23 10:11:48 +0000
commit25f05e7bf142ad370a0da6681a6971ce565dc5c2 (patch)
tree0a40a5c43bd3f71bca72f5667af3f0cab6688b94 /gcc/cp/parser.c
parent7bed1d3d811b3e609593c4ff45ec5c554fba0143 (diff)
downloadgcc-25f05e7bf142ad370a0da6681a6971ce565dc5c2.zip
gcc-25f05e7bf142ad370a0da6681a6971ce565dc5c2.tar.gz
gcc-25f05e7bf142ad370a0da6681a6971ce565dc5c2.tar.bz2
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
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index f1d5656..920cb61 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -11660,7 +11660,8 @@ cp_parser_simple_declaration (cp_parser* parser,
{
/* If we have already issued an error message we don't need
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_error (parser, "expected %<,%> or %<;%>");
/* Skip tokens until we reach the end of the statement. */