diff options
| author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-02 20:04:56 +0000 |
|---|---|---|
| committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-02 20:04:56 +0000 |
| commit | b500215675ffd2b767a5f77eeeb9290b80ebe528 (patch) | |
| tree | 55015d7cc2c4fc651c6535b32fa73144f1ee2f1b | |
| parent | 09d4932303a58615d5e53ee9a0dc03d07e0b339e (diff) | |
| download | ppe42-gcc-b500215675ffd2b767a5f77eeeb9290b80ebe528.tar.gz ppe42-gcc-b500215675ffd2b767a5f77eeeb9290b80ebe528.zip | |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60801 138bc75d-0d04-0410-961f-82ee72b054a4
| -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 9d078c63b5b..c23e42391c6 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 f9c690c11c0..dca6853edc8 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 5e485480122..bd61d145a8a 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 00000000000..fa16fdd98cd --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attrib7.C @@ -0,0 +1,3 @@ +// { dg-options "-Wunused-parameter" } + +void f (int i __attribute__((__unused__))) {} |

