------- Comment #7 from pinskia at gcc dot gnu dot org 2005-11-08 01:34 ------- Actually I don't think my patch is the right one. Here is the patch: svn diff Index: tree.c =================================================================== --- tree.c (revision 106572) +++ tree.c (working copy) @@ -2168,7 +2168,12 @@ decl_linkage (tree decl) /* 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))); + { + /* If we are inside a template, the type will be null. */ + if (!TREE_TYPE (decl)) + return lk_external; + 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 -- pinskia at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|pinskia at gcc dot gnu dot |unassigned at gcc dot gnu |org |dot org Status|ASSIGNED |NEW http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24687