diff options
author | Richard Sandiford <richard@codesourcery.com> | 2007-09-12 13:16:42 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2007-09-12 13:16:42 +0000 |
commit | b9baeecdcc22a80357e232383421c6cb0cd3ab69 (patch) | |
tree | 3cb5e6af2cd22e35ac9a75b750a8820ca617d258 /gcc/c-parser.c | |
parent | ed557735d747bae60ca5d1c7f9f04088eaba5f69 (diff) | |
download | gcc-b9baeecdcc22a80357e232383421c6cb0cd3ab69.zip gcc-b9baeecdcc22a80357e232383421c6cb0cd3ab69.tar.gz gcc-b9baeecdcc22a80357e232383421c6cb0cd3ab69.tar.bz2 |
c-tree.h (grokfield): Add a "tree *" argument.
gcc/
* c-tree.h (grokfield): Add a "tree *" argument.
* c-decl.c (grokdeclarator): Take a pointer to the decl's attributes.
Chain nested decl attributes to it. Don't call decl_attributes here.
(groktypename): Pass grokdeclarator a pointer to the attribute list.
(start_decl, grokparm, push_parm_decl, start_function): Likewise.
(grokfield): Take a pointer to the decl's attributes and pass
it to grokdeclarator.
* c-parser.c (c_parser_struct_declaration): Update the calls to
grokfield. Call decl_attributes for anonymous struct and union
fields.
From-SVN: r128437
Diffstat (limited to 'gcc/c-parser.c')
-rw-r--r-- | gcc/c-parser.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/c-parser.c b/gcc/c-parser.c index 4cd9479..4bbc39d 100644 --- a/gcc/c-parser.c +++ b/gcc/c-parser.c @@ -2030,7 +2030,10 @@ c_parser_struct_declaration (c_parser *parser) /* Support for unnamed structs or unions as members of structs or unions (which is [a] useful and [b] supports MS P-SDK). */ - ret = grokfield (build_id_declarator (NULL_TREE), specs, NULL_TREE); + tree attrs = NULL; + ret = grokfield (build_id_declarator (NULL_TREE), specs, + NULL_TREE, &attrs); + decl_attributes (&ret, attrs, 0); } return ret; } @@ -2070,7 +2073,7 @@ c_parser_struct_declaration (c_parser *parser) } if (c_parser_next_token_is_keyword (parser, RID_ATTRIBUTE)) postfix_attrs = c_parser_attributes (parser); - d = grokfield (declarator, specs, width); + d = grokfield (declarator, specs, width, &all_prefix_attrs); decl_attributes (&d, chainon (postfix_attrs, all_prefix_attrs), 0); TREE_CHAIN (d) = decls; |