re PR c++/22452 (ICE expected tree that contains 'decl with visibility' structure...
authorDaniel Berlin <dberlin@dberlin.org>
Fri, 15 Jul 2005 20:22:39 +0000 (20:22 +0000)
committerDaniel Berlin <dberlin@gcc.gnu.org>
Fri, 15 Jul 2005 20:22:39 +0000 (20:22 +0000)
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

gcc/cp/ChangeLog
gcc/cp/tree.c

index a52464a20e4495f3953cf76a5daf7b1ab8543742..e13653c4a2449bfec4ae1617e6c65b87d66e2e03 100644 (file)
@@ -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
index e0eb1ac6ef74ed26470ded94f25157f4d6e4206a..0cf6b4ebc1ad72b66f1b9a06d6b5b1147947f738 100644 (file)
@@ -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