This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10661: ICE in instantiate_decl, at cp/pt.c:10052 while instantiating static member variables
- From: giovannibajo at libero dot it
- To: gawrilow at math dot tu-berlin dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, giovannibajo at libero dot it, nobody at gcc dot gnu dot org
- Date: 8 May 2003 17:07:36 -0000
- Subject: Re: c++/10661: ICE in instantiate_decl, at cp/pt.c:10052 while instantiating static member variables
- Reply-to: giovannibajo at libero dot it, gawrilow at math dot tu-berlin dot de, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, giovannibajo at libero dot it, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
Old Synopsis: [3.3/3.4? regression] ICE in instantiate_decl
New Synopsis: ICE in instantiate_decl, at cp/pt.c:10052 while instantiating static member variables
Responsible-Changed-From-To: bajo->unassigned
Responsible-Changed-By: bajo
Responsible-Changed-When: Thu May 8 17:07:36 2003
Responsible-Changed-Why:
Analysys is done
State-Changed-From-To: open->analyzed
State-Changed-By: bajo
State-Changed-When: Thu May 8 17:07:36 2003
State-Changed-Why:
Ok, I'm done with this report. This is the reduced
snippet that triggers the bug:
------------------------------------------------
template <class A>
struct Foo
{
static const int var = 0;
template <class>
struct Nested
{
static const int nested_var = var;
};
};
template <class A>
struct Bar
{
typename Foo<A>::Nested<void> a;
};
template struct Bar<void>;
------------------------------------------------
pr10661.cpp: In instantiation of `const int Foo<void>::var':
pr10661.cpp:9: instantiated from `Foo<void>::Nested<void>'
pr10661.cpp:16: instantiated from `Bar<void>'
pr10661.cpp:19: instantiated from here
pr10661.cpp:4: internal compiler error: in instantiate_decl, at cp/pt.c:10330
Please submit a full bug report,
As anticipated, the code is illegal: it's missing a
keyword 'template' in line 16, but we should not ICE
anyway. Now the funny thing is, this reduced snippet
is not a regression. I have no _clue_ why the original
big testcase did compile on 3.2, probably for some weird
reason. And I will _not_ go through everything again to
find the difference, since there is an easy fix for this:
just make the code legal.
Anyway, while working on this I forked out about 10 other
ICEs, which I will file to GNATS and analyze in the next
few days.
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10661