aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2006-07-20 12:02:57 -0400
committerJason Merrill <jason@gcc.gnu.org>2006-07-20 12:02:57 -0400
commitb70f0f48c716c8571723ee667f9712fd7e097490 (patch)
tree2668380ba111a9cfdf1beb690c74127fc5593651 /gcc/tree.c
parente67b81d14078e85aff856cd25679a4f349e9c3b4 (diff)
downloadgcc-b70f0f48c716c8571723ee667f9712fd7e097490.zip
gcc-b70f0f48c716c8571723ee667f9712fd7e097490.tar.gz
gcc-b70f0f48c716c8571723ee667f9712fd7e097490.tar.bz2
re PR c++/28407 (Issue with anonymous namespace)
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. From-SVN: r115622
Diffstat (limited to 'gcc/tree.c')
-rw-r--r--gcc/tree.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index 48f4614..dc78ad7 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