From 607c855eb7fbf6b876250fe3e580125e7bf438d6 Mon Sep 17 00:00:00 2001 From: Volker Reichelt Date: Thu, 19 Jan 2006 09:51:57 +0000 Subject: re PR c++/16829 (default parameter can be not one of the last in function) PR c++/16829 * decl.c (start_preparsed_function): Check default arguments unconditionally. * name-lookup.c (pushdecl_maybe_friend): Check default arguments of all functions and function templates. * parser.c (cp_parser_late_parsing_default_args): Check default arguments. * decl2.c (check_default_args): Set missing default arguments to error_mark_node. * g++.dg/other/default2.C: New test. * g++.dg/other/default3.C: New test. From-SVN: r109950 --- gcc/cp/parser.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc/cp/parser.c') diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index ec4c2ea..d2b41e5 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -15833,6 +15833,9 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn) cp_parser_pop_lexer (parser); } + /* Make sure no default arg is missing. */ + check_default_args (fn); + /* Restore the state of local_variables_forbidden_p. */ parser->local_variables_forbidden_p = saved_local_variables_forbidden_p; -- cgit v1.1