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
This commit is contained in:
parent
5e8a153a54
commit
4971227d25
4 changed files with 14 additions and 0 deletions
|
@ -1,5 +1,9 @@
|
|||
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
|
||||
string.
|
||||
|
||||
|
|
|
@ -10845,6 +10845,8 @@ cp_parser_parameter_declaration (parser, greater_than_is_operator_p)
|
|||
/*abstract_p=*/true,
|
||||
/*ctor_dtor_or_conv_p=*/NULL);
|
||||
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
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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>
|
||||
|
||||
* g++.dg/parse/parse6.C: New test.
|
||||
|
|
3
gcc/testsuite/g++.dg/ext/attrib7.C
Normal file
3
gcc/testsuite/g++.dg/ext/attrib7.C
Normal file
|
@ -0,0 +1,3 @@
|
|||
// { dg-options "-Wunused-parameter" }
|
||||
|
||||
void f (int i __attribute__((__unused__))) {}
|
Loading…
Add table
Reference in a new issue