diff options
-rw-r--r-- | gcc/cp/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/cp/parser.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/attrib7.C | 3 |
4 files changed, 14 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9d078c6..c23e423 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f9c690c..dca6853 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -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 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5e48548..bd61d14 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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. diff --git a/gcc/testsuite/g++.dg/ext/attrib7.C b/gcc/testsuite/g++.dg/ext/attrib7.C new file mode 100644 index 0000000..fa16fdd --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attrib7.C @@ -0,0 +1,3 @@ +// { dg-options "-Wunused-parameter" } + +void f (int i __attribute__((__unused__))) {} |