+2011-02-23 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR c++/46868
+ * parser.c (cp_parser_class_specifier): Require a closing brace
+ to attempt error recovery.
+
2011-02-23 Jakub Jelinek <jakub@redhat.com>
PR c++/47833
tree old_scope = NULL_TREE;
tree scope = NULL_TREE;
tree bases;
+ cp_token *closing_brace;
push_deferring_access_checks (dk_no_deferred);
cp_parser_member_specification_opt (parser);
/* Look for the trailing `}'. */
- cp_parser_require (parser, CPP_CLOSE_BRACE, RT_CLOSE_BRACE);
+ closing_brace = cp_parser_require (parser, CPP_CLOSE_BRACE, RT_CLOSE_BRACE);
/* Look for trailing attributes to apply to this class. */
if (cp_parser_allow_gnu_extensions_p (parser))
attributes = cp_parser_attributes_opt (parser);
}
/* If we don't have a type, then something is very wrong and we
- shouldn't try to do anything clever. */
- if (TYPE_P (type) && want_semicolon)
+ shouldn't try to do anything clever. Likewise for not seeing the
+ closing brace. */
+ if (closing_brace && TYPE_P (type) && want_semicolon)
{
cp_token_position prev
= cp_lexer_previous_token_position (parser->lexer);
+2011-02-23 Nathan Froyd <froydnj@codesourcery.com>
+
+ PR c++/46868
+ * g++.dg/pr46868.C: New test.
+ * g++.dg/parse/parameter-declaration-1.C: Adjust.
+ * g++.dg/parse/error14.C: Adjust.
+
2011-02-23 Richard Guenther <rguenther@suse.de>
PR tree-optimization/47838
}; // { dg-error "2:expected '.' at end of input" "at end of input" }
// { dg-error "1:expected primary-expression before '.' token" "primary" { target *-*-* } 22 }
- // { dg-error "2:expected ';' after struct definition" "semicolon" { target *-*-* } 22 }
+ // { dg-error "1:expected unqualified-id" "unqualified-id" { target *-*-* } 22 }
// { dg-error "1:expected ';' before '.' token" "function" { target *-*-* } 22 }