This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31992] [4.1/4.2/4.3 regression] ICE initializing static variable of template class
- From: "brolley at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Jul 2007 20:05:11 -0000
- Subject: [Bug c++/31992] [4.1/4.2/4.3 regression] ICE initializing static variable of template class
- References: <bug-31992-1771@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from brolley at redhat dot com 2007-07-05 20:05 -------
I've worked on this a bit and just realized that it's assigned to Mark
Mitchell. However, here's what I've learned, in case it helps...
The segfault occurs in convert_for_initialization because the TREE_TYPE of rhs
is NULL_TREE. This is because the tree is a SCOPE_REF referring to A and i. The
TREE_TYPE was set to NULL_TREE because A is a dependent type. Now, it's
documented in build_qualified_name in cp/tree.c that a SCOPE_REF has NULL type
in the event that the expression represents a dependent type. However, since i
does not depend on any of the template parameters of A, I think that A::i is
not a dependent type and that the TREE_TYPE should have been set to the type of
i.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31992