Commit 98d43360 by Jason Merrill Committed by Jason Merrill

re PR c++/44991 (default argument with '<' cause compilation error)

	PR c++/44991
	* parser.c (cp_parser_parameter_declaration): Pop parameter decls
	after tentative parsing.

From-SVN: r163629
parent 1f5ca1a1
2010-08-29 Jason Merrill <jason@redhat.com>
PR c++/44991
* parser.c (cp_parser_parameter_declaration): Pop parameter decls
after tentative parsing.
2010-08-22 Joseph Myers <joseph@codesourcery.com>
* Make-lang.in (g++spec.o): Update dependencies.
......
......@@ -15564,6 +15564,7 @@ cp_parser_parameter_declaration (cp_parser *parser,
the default argument; otherwise the default
argument continues. */
bool error = false;
tree t;
/* Set ITALP so cp_parser_parameter_declaration_list
doesn't decide to commit to this parse. */
......@@ -15572,7 +15573,11 @@ cp_parser_parameter_declaration (cp_parser *parser,
cp_parser_parse_tentatively (parser);
cp_lexer_consume_token (parser->lexer);
begin_scope (sk_function_parms, NULL_TREE);
cp_parser_parameter_declaration_list (parser, &error);
for (t = current_binding_level->names; t; t = DECL_CHAIN (t))
pop_binding (DECL_NAME (t), t);
leave_scope ();
if (!cp_parser_error_occurred (parser) && !error)
done = true;
cp_parser_abort_tentative_parse (parser);
......
2010-08-29 Jason Merrill <jason@redhat.com>
PR c++/44991
* g++.dg/parse/defarg15.C: New.
2010-08-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/45439
......
// PR c++/44991
class bar {
void foo(bool a = 3 < 2, bool b = true) {}
};
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