This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9443: ICE in resolve_scoped_fn_name, at cp/call.c:2604
- From: Volker Reichelt <reichelt at igpm dot rwth-aachen dot de>
- To: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, larsbj at gullik dot net
- Date: Fri, 31 Jan 2003 17:50:18 +0100
- Subject: Re: c++/9443: ICE in resolve_scoped_fn_name, at cp/call.c:2604
That was really a tough one, but here's a shorter testcase, nevertheless:
-----------------------------snip here------------------------------
struct A
{
int i;
};
template <int> struct B
{
int foo() { return A::i; } // illegal
};
void bar() { B<0>().foo(); }
-----------------------------snip here------------------------------
With gcc 3.4-20030127 I get the following ICE (which matches the submitter's):
PR9443.ii: In member function `void* B<<anonymous> >::foo() [with int
<anonymous> = 0]':
PR9443.ii:11: instantiated from here
PR9443.ii:8: internal compiler error: in c_expand_expr, at c-common.c:4338
Please submit a full bug report, [etc.]
So that's in fact an ice-on-illegal-code. (Wolfgang, you got a different
ICE, did you configure your compiler with --enable-checking?)
When I get rid of the unused template parameter, I get a segfault instead.
Even stranger: If I replace "return A::i;" by "return A::j;" the code compiles,
although "j" is defined nowhere. So that's an additional accepts-illegal.
Since we get no error message with 3.2/3.3 branch, I rate this as a
regression. (Although the error message is a little misleading:
PR9443.ii:8: error: type `A' is not a base type for type `B<0>')
Regards,
Volker
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9443