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
This commit is contained in:
Nathan Sidwell 2003-07-27 16:51:14 +00:00 committed by Nathan Sidwell
parent cc33095ccf
commit c67d36d0d7
2 changed files with 15 additions and 7 deletions

View file

@ -1,3 +1,9 @@
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>
* cfns.h: Rebuilt.

View file

@ -7305,8 +7305,7 @@ cp_parser_type_parameter (cp_parser* parser)
/* Create the combined representation of the parameter and the
default argument. */
parameter = build_tree_list (default_argument,
parameter);
parameter = build_tree_list (default_argument, parameter);
}
break;
@ -7365,8 +7364,7 @@ cp_parser_type_parameter (cp_parser* parser)
/* Create the combined representation of the parameter and the
default argument. */
parameter = build_tree_list (default_argument,
parameter);
parameter = build_tree_list (default_argument, parameter);
}
break;
@ -10498,9 +10496,13 @@ cp_parser_parameter_declaration (cp_parser *parser,
}
if (!parser->default_arg_ok_p)
{
pedwarn ("default arguments are only permitted on functions");
if (flag_pedantic_errors)
default_argument = NULL_TREE;
if (!flag_pedantic_errors)
warning ("deprecated use of default argument for parameter of non-function");
else
{
error ("default arguments are only permitted for function parameters");
default_argument = NULL_TREE;
}
}
}
else