diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-20 16:02:57 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-07-20 16:02:57 +0000 |
commit | 6a47600ccb509de8d9fc9f603e91990ae71479c1 (patch) | |
tree | 2668380ba111a9cfdf1beb690c74127fc5593651 /gcc/tree.c | |
parent | d249588e4325dd5715ee30acfd2e97701407b5fa (diff) | |
download | gcc-6a47600ccb509de8d9fc9f603e91990ae71479c1.tar.gz |
PR c++/28407
* cp/decl.c (grokvardecl): Set DECL_THIS_STATIC on file-scope
const variables with implicit internal linkage.
* cp/tree.c (decl_linkage): Only return lk_external if it's set.
PR c++/28409
* cp/decl2.c (constrain_visibility): Ignore the anonymous namespace
for extern C decls.
(VISIBILITY_STATIC): Rename to VISIBILITY_ANON.
Don't override explicit visibility.
* cp/decl2.c (constrain_visibility): Remove specified and reason
parameters. Don't touch decls that already have explicit visibility.
(determine_visibility): Do copy DECL_VISIBILITY_SPECIFIED from
template.
(determine_visibility_from_class): Reverse sense of
DECL_VISIBILITY_SPECIFIED test for target-specific visibility rules.
(constrain_class_visibility): Only complain about member visibility
if the member type is another class. Don't change visibility of the
current class.
* tree.c (remove_attribute): New fn.
* tree.h: Declare it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115622 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree.c')
-rw-r--r-- | gcc/tree.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c index 48f4614ceae..dc78ad775af 100644 --- a/gcc/tree.c +++ b/gcc/tree.c @@ -3499,6 +3499,28 @@ lookup_attribute (const char *attr_name, tree list) return NULL_TREE; } +/* Remove any instances of attribute ATTR_NAME in LIST and return the + modified list. */ + +tree +remove_attribute (const char *attr_name, tree list) +{ + tree *p; + size_t attr_len = strlen (attr_name); + + for (p = &list; *p; ) + { + tree l = *p; + gcc_assert (TREE_CODE (TREE_PURPOSE (l)) == IDENTIFIER_NODE); + if (is_attribute_with_length_p (attr_name, attr_len, TREE_PURPOSE (l))) + *p = TREE_CHAIN (l); + else + p = &TREE_CHAIN (l); + } + + return list; +} + /* Return an attribute list that is the union of a1 and a2. */ tree |