diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2005-07-15 20:22:39 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@gcc.gnu.org> | 2005-07-15 20:22:39 +0000 |
commit | 3f774254dbed681d86c023cac491a8c38188d76c (patch) | |
tree | 2aeacd0058dd2e06e1435cf3c79b59a209d5f7ea | |
parent | be9c593a8a0463306f6abff8a9eedbe1c5fa227c (diff) | |
download | gcc-3f774254dbed681d86c023cac491a8c38188d76c.zip gcc-3f774254dbed681d86c023cac491a8c38188d76c.tar.gz gcc-3f774254dbed681d86c023cac491a8c38188d76c.tar.bz2 |
re PR c++/22452 (ICE expected tree that contains 'decl with visibility' structure, have 'const_decl' in decl_linkage, at cp/tree.c:2132)
2005-07-14 Daniel Berlin <dberlin@dberlin.org>
Fix PR c++/22452
* tree.c (decl_linkage): Don't check DECL_COMDAT on CONST_DECL.
From-SVN: r102063
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/tree.c | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a52464a..e13653c 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 e0eb1ac..0cf6b4e 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 |