summaryrefslogtreecommitdiff
path: root/gcc/attribs.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-23 15:11:22 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-23 15:11:22 +0000
commit8ef83079e8afeb0ada8dd045ecca74cc63025815 (patch)
tree44efa0a8d484a43a1c9fdcb6ee639b42bc12b3b8 /gcc/attribs.c
parentd1f34b6d3ee83ad3edafcebe24e66b410c8b99e3 (diff)
downloadgcc-8ef83079e8afeb0ada8dd045ecca74cc63025815.tar.gz
2010-03-23 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 157669 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@157672 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/attribs.c')
-rw-r--r--gcc/attribs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/attribs.c b/gcc/attribs.c
index 9f2f50bdfd9..9d76a0c30db 100644
--- a/gcc/attribs.c
+++ b/gcc/attribs.c
@@ -286,6 +286,7 @@ decl_attributes (tree *node, tree attributes, int flags)
tree *anode = node;
const struct attribute_spec *spec = lookup_attribute_spec (name);
bool no_add_attrs = 0;
+ int fn_ptr_quals = 0;
tree fn_ptr_tmp = NULL_TREE;
if (spec == NULL)
@@ -353,6 +354,7 @@ decl_attributes (tree *node, tree attributes, int flags)
This would all be simpler if attributes were part of the
declarator, grumble grumble. */
fn_ptr_tmp = TREE_TYPE (*anode);
+ fn_ptr_quals = TYPE_QUALS (*anode);
anode = &fn_ptr_tmp;
flags &= ~(int) ATTR_FLAG_TYPE_IN_PLACE;
}
@@ -449,6 +451,8 @@ decl_attributes (tree *node, tree attributes, int flags)
/* Rebuild the function pointer type and put it in the
appropriate place. */
fn_ptr_tmp = build_pointer_type (fn_ptr_tmp);
+ if (fn_ptr_quals)
+ fn_ptr_tmp = build_qualified_type (fn_ptr_tmp, fn_ptr_quals);
if (DECL_P (*node))
TREE_TYPE (*node) = fn_ptr_tmp;
else