diff options
author | Simon Martin <simartin@users.sourceforge.net> | 2008-06-14 05:21:30 +0000 |
---|---|---|
committer | Simon Martin <simartin@gcc.gnu.org> | 2008-06-14 05:21:30 +0000 |
commit | a6d9bc9dda3c7e4fe4475016fff3a9c45bc97c54 (patch) | |
tree | 49becebf3f85a8957f6c86b09667c1331cf064cb /gcc/cp/decl2.c | |
parent | 74bae98e59788f0fd3466aeecb9f549f9afc66e5 (diff) | |
download | gcc-a6d9bc9dda3c7e4fe4475016fff3a9c45bc97c54.zip gcc-a6d9bc9dda3c7e4fe4475016fff3a9c45bc97c54.tar.gz gcc-a6d9bc9dda3c7e4fe4475016fff3a9c45bc97c54.tar.bz2 |
re PR c++/35320 (ICE with invalid friend declaration)
gcc/cp/
2008-06-14 Simon Martin <simartin@users.sourceforge.net>
PR c++/35320
* decl2.c (grokbitfield): Receive the list of attributes, pass it to
grokdeclarator and apply it to the created declaration.
* cp-tree.h (grokbitfield): Update prototype.
* parser.c (cp_parser_member_declaration): Don't apply the attributes
since they are now applied in grokbitfield. Adjusted the call to
grokbitfield.
(cp_parser_objc_class_ivars): Likewise.
gcc/testsuite/
2008-06-14 Simon Martin <simartin@users.sourceforge.net>
PR c++/35320
* g++.dg/parse/bitfield3.C: New test.
From-SVN: r136778
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r-- | gcc/cp/decl2.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 41af32f..ca9440f 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -914,9 +914,10 @@ grokfield (const cp_declarator *declarator, tree grokbitfield (const cp_declarator *declarator, - cp_decl_specifier_seq *declspecs, tree width) + cp_decl_specifier_seq *declspecs, tree width, + tree attrlist) { - tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL); + tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, &attrlist); if (value == error_mark_node) return NULL_TREE; /* friends went bad. */ @@ -972,6 +973,10 @@ grokbitfield (const cp_declarator *declarator, } DECL_IN_AGGR_P (value) = 1; + + if (attrlist) + cplus_decl_attributes (&value, attrlist, /*flags=*/0); + return value; } |