aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>2001-07-13 21:40:43 +0100
committerJoseph Myers <jsm28@gcc.gnu.org>2001-07-13 21:40:43 +0100
commit59387d2e310983bced3bf86cb759a1dbc1520277 (patch)
tree7344925821f5f63d7da1217406a45dd134918cfd /gcc/cp/decl2.c
parente47c5acd7b2c5dcaf4ece03897e9baa12e867cf9 (diff)
downloadgcc-59387d2e310983bced3bf86cb759a1dbc1520277.zip
gcc-59387d2e310983bced3bf86cb759a1dbc1520277.tar.gz
gcc-59387d2e310983bced3bf86cb759a1dbc1520277.tar.bz2
c-common.c (decl_attributes): Take a pointer to the node to which attributes are to be attached...
* c-common.c (decl_attributes): Take a pointer to the node to which attributes are to be attached, and a flags argument. * c-common.h (enum attribute_flags): New. (decl_attributes): Update prototype. * c-decl.c (start_decl, push_parm_decl, finish_struct, finish_enum, start_function): Update calls to decl_attributes. * c-parse.in (component_declarator, component_notype_declarator, label): Update calls to decl_attributes. cp: * decl2.c (cplus_decl_attributes): Take a pointer to the node to which attributes are to be attached, and a flags argument. Update call to decl_attributes. (grokfield): Update call to decl_attributes. * class.c (finish_struct): Update call to cplus_decl_attributes. * cp-tree.h (cplus_decl_attributes): Update prototype. * decl.c (start_decl, grokdeclarator, start_function): Update calls to decl_attributes and cplus_decl_attributes. * friend.c (do_friend): Update call to cplus_decl_attributes. * parse.y (parse_bitfield): Update call to cplus_decl_attributes. From-SVN: r43995
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index e6d4274..5a1a1ed 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1531,7 +1531,7 @@ tree
grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
tree declarator, declspecs, init, asmspec_tree, attrlist;
{
- register tree value;
+ tree value;
const char *asmspec = 0;
int flags = LOOKUP_ONLYCONVERTING;
@@ -1679,8 +1679,8 @@ grokfield (declarator, declspecs, init, asmspec_tree, attrlist)
value = push_template_decl (value);
if (attrlist)
- cplus_decl_attributes (value, TREE_PURPOSE (attrlist),
- TREE_VALUE (attrlist));
+ cplus_decl_attributes (&value, TREE_PURPOSE (attrlist),
+ TREE_VALUE (attrlist), 0);
if (TREE_CODE (value) == VAR_DECL)
{
@@ -1875,19 +1875,20 @@ grok_function_init (decl, init)
}
void
-cplus_decl_attributes (decl, attributes, prefix_attributes)
- tree decl, attributes, prefix_attributes;
+cplus_decl_attributes (decl, attributes, prefix_attributes, flags)
+ tree *decl, attributes, prefix_attributes;
+ int flags;
{
- if (decl == NULL_TREE || decl == void_type_node)
+ if (*decl == NULL_TREE || *decl == void_type_node)
return;
- if (TREE_CODE (decl) == TEMPLATE_DECL)
- decl = DECL_TEMPLATE_RESULT (decl);
+ if (TREE_CODE (*decl) == TEMPLATE_DECL)
+ decl = &DECL_TEMPLATE_RESULT (*decl);
- decl_attributes (decl, chainon (attributes, prefix_attributes));
+ decl_attributes (decl, chainon (attributes, prefix_attributes), flags);
- if (TREE_CODE (decl) == TYPE_DECL)
- SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (decl), TREE_TYPE (decl));
+ if (TREE_CODE (*decl) == TYPE_DECL)
+ SET_IDENTIFIER_TYPE_VALUE (DECL_NAME (*decl), TREE_TYPE (*decl));
}
/* CONSTRUCTOR_NAME: