From a6d9bc9dda3c7e4fe4475016fff3a9c45bc97c54 Mon Sep 17 00:00:00 2001 From: Simon Martin Date: Sat, 14 Jun 2008 05:21:30 +0000 Subject: re PR c++/35320 (ICE with invalid friend declaration) gcc/cp/ 2008-06-14 Simon Martin 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 PR c++/35320 * g++.dg/parse/bitfield3.C: New test. From-SVN: r136778 --- gcc/cp/parser.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'gcc/cp/parser.c') diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 12d1a2d..467a603 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -15238,9 +15238,8 @@ cp_parser_member_declaration (cp_parser* parser) sfk_none) : NULL, &decl_specifiers, - width); - /* Apply the attributes. */ - cplus_decl_attributes (&decl, attributes, /*flags=*/0); + width, + attributes); } else { @@ -19150,11 +19149,10 @@ cp_parser_objc_class_ivars (cp_parser* parser) attributes = chainon (prefix_attributes, attributes); if (width) - { /* Create the bitfield declaration. */ - decl = grokbitfield (declarator, &declspecs, width); - cplus_decl_attributes (&decl, attributes, /*flags=*/0); - } + decl = grokbitfield (declarator, &declspecs, + width, + attributes); else decl = grokfield (declarator, &declspecs, NULL_TREE, /*init_const_expr_p=*/false, -- cgit v1.1