summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authordberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-15 20:22:39 +0000
committerdberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4>2005-07-15 20:22:39 +0000
commitebf5d1a8bc1ede9128673a160be7cb7c9753e862 (patch)
tree2aeacd0058dd2e06e1435cf3c79b59a209d5f7ea /gcc
parent3031a1be0d74c511979e4253c372ac4acb5fc374 (diff)
downloadgcc-ebf5d1a8bc1ede9128673a160be7cb7c9753e862.tar.gz
2005-07-14 Daniel Berlin <dberlin@dberlin.org>
Fix PR c++/22452 * tree.c (decl_linkage): Don't check DECL_COMDAT on CONST_DECL. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102063 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/tree.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a52464a20e4..e13653c4a24 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2005-07-14 Daniel Berlin <dberlin@dberlin.org>
+
+ Fix PR c++/22452
+ * tree.c (decl_linkage): Don't check DECL_COMDAT on CONST_DECL.
+
2005-07-15 Mark Mitchell <mark@codesourcery.com>
PR c++/22132
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index e0eb1ac6ef7..0cf6b4ebc1a 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -2123,6 +2123,11 @@ decl_linkage (tree decl)
/* Things that are TREE_PUBLIC have external linkage. */
if (TREE_PUBLIC (decl))
return lk_external;
+
+ /* Linkage of a CONST_DECL depends on the linkage of the enumeration
+ type. */
+ if (TREE_CODE (decl) == CONST_DECL)
+ return decl_linkage (TYPE_NAME (TREE_TYPE (decl)));
/* Some things that are not TREE_PUBLIC have external linkage, too.
For example, on targets that don't have weak symbols, we make all