Commit 4971227d by Mark Mitchell Committed by Mark Mitchell

re PR c++/2843 (parser: __attribute__ on parameter declarations)

	PR c++/2843
	* parser.c (cp_parser_parameter_declaration): Allow attributes to
	appear after the declarator.

	PR c++/2843
	* g++.dg/ext/attrib7.C: New test.

From-SVN: r60801
parent 5e8a153a
2003-01-02 Mark Mitchell <mark@codesourcery.com> 2003-01-02 Mark Mitchell <mark@codesourcery.com>
PR c++/2843
* parser.c (cp_parser_parameter_declaration): Allow attributes to
appear after the declarator.
* call.c (build_new_method_call): Fix typo in message format * call.c (build_new_method_call): Fix typo in message format
string. string.
......
...@@ -10845,6 +10845,8 @@ cp_parser_parameter_declaration (parser, greater_than_is_operator_p) ...@@ -10845,6 +10845,8 @@ cp_parser_parameter_declaration (parser, greater_than_is_operator_p)
/*abstract_p=*/true, /*abstract_p=*/true,
/*ctor_dtor_or_conv_p=*/NULL); /*ctor_dtor_or_conv_p=*/NULL);
parser->default_arg_ok_p = saved_default_arg_ok_p; parser->default_arg_ok_p = saved_default_arg_ok_p;
/* After the declarator, allow more attributes. */
attributes = chainon (attributes, cp_parser_attributes_opt (parser));
} }
/* The restriction on definining new types applies only to the type /* The restriction on definining new types applies only to the type
......
2003-01-02 Mark Mitchell <mark@codesourcery.com>
PR c++/2843
* g++.dg/ext/attrib7.C: New test.
2003-01-02 Neil Booth <neil@daikokuya.co.uk> 2003-01-02 Neil Booth <neil@daikokuya.co.uk>
* g++.dg/parse/parse6.C: New test. * g++.dg/parse/parse6.C: New test.
......
// { dg-options "-Wunused-parameter" }
void f (int i __attribute__((__unused__))) {}
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