Commit c67d36d0 by Nathan Sidwell Committed by Nathan Sidwell

parser.c (cp_parser_type_parameter): Reformat.

	* parser.c (cp_parser_type_parameter): Reformat.
	(cp_parser_parameter_declaration): Deprecate default args where
	not allowed.

From-SVN: r69852
parent cc33095c
2003-07-27 Nathan Sidwell <nathan@codesourcery.com>
* parser.c (cp_parser_type_parameter): Reformat.
(cp_parser_parameter_declaration): Deprecate default args where
not allowed.
2003-07-26 Nathan Sidwell <nathan@codesourcery.com> 2003-07-26 Nathan Sidwell <nathan@codesourcery.com>
* cfns.h: Rebuilt. * cfns.h: Rebuilt.
......
...@@ -7305,8 +7305,7 @@ cp_parser_type_parameter (cp_parser* parser) ...@@ -7305,8 +7305,7 @@ cp_parser_type_parameter (cp_parser* parser)
/* Create the combined representation of the parameter and the /* Create the combined representation of the parameter and the
default argument. */ default argument. */
parameter = build_tree_list (default_argument, parameter = build_tree_list (default_argument, parameter);
parameter);
} }
break; break;
...@@ -7365,8 +7364,7 @@ cp_parser_type_parameter (cp_parser* parser) ...@@ -7365,8 +7364,7 @@ cp_parser_type_parameter (cp_parser* parser)
/* Create the combined representation of the parameter and the /* Create the combined representation of the parameter and the
default argument. */ default argument. */
parameter = build_tree_list (default_argument, parameter = build_tree_list (default_argument, parameter);
parameter);
} }
break; break;
...@@ -10498,9 +10496,13 @@ cp_parser_parameter_declaration (cp_parser *parser, ...@@ -10498,9 +10496,13 @@ cp_parser_parameter_declaration (cp_parser *parser,
} }
if (!parser->default_arg_ok_p) if (!parser->default_arg_ok_p)
{ {
pedwarn ("default arguments are only permitted on functions"); if (!flag_pedantic_errors)
if (flag_pedantic_errors) warning ("deprecated use of default argument for parameter of non-function");
default_argument = NULL_TREE; else
{
error ("default arguments are only permitted for function parameters");
default_argument = NULL_TREE;
}
} }
} }
else else
......
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