[patch] Fix PR c++/16829: Diagnose missing default parameters
Mark Mitchell
mark@codesourcery.com
Mon Jan 16 00:27:00 GMT 2006
Volker Reichelt wrote:
> When a function parameter has a default value, all subsequent
> parameters must have one, too. Unfortunately, we failed to diagnose
> violations of this rule in several circumstances (mostly in templates).
Ouch; thanks for fixing this.
> 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.
OK, thanks.
:REVIEWMAIL:
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713
More information about the Gcc-patches
mailing list