User account creation filtered due to spam.

Bug 13310 - Tree check error in dependent_template_p
Summary: Tree check error in dependent_template_p
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
Keywords: ice-on-invalid-code, monitored
Depends on:
Blocks: 12944
  Show dependency treegraph
Reported: 2003-12-05 01:13 UTC by Wolfgang Bangerth
Modified: 2003-12-15 21:56 UTC (History)
3 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2003-12-05 01:33:10


Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bangerth 2003-12-05 01:13:09 UTC
Playing around with 13306, I find this:  
template <typename> struct A {  
        template <typename> void g() {}  
template <typename> void f() {  
  A<int> a;  
The code is invalid, because there is no A::f, but instead of an error  
we get on present mainline 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c In function `void f()': internal compiler error: tree check: expected class 'd', have  
'x' (overload) in dependent_template_p, at cp/pt.c:11926  
I don't think that's much of a regression since pre-3.4 we silently accepted 
this in the absence of two-stage name lookup. It would be nice to have it 
fixed for 3.4 anyway, though. 
Comment 1 Andrew Pinski 2003-12-05 01:33:10 UTC
This ICE without checking: In function `void f()': internal compiler error: in lookup_member, at cp/search.c:1228
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:> for instructions.
Comment 2 Volker Reichelt 2003-12-08 02:17:26 UTC
Here's an even simpler testcase:

struct A {};

template <typename> void foo()
    A a;<int>();
Comment 3 CVS Commits 2003-12-15 21:55:25 UTC
Subject: Bug 13310

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	2003-12-15 21:55:20

Modified files:
	gcc/cp         : ChangeLog pt.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/template: crash15.C 

Log message:
	PR c++/13310
	* pt.c (dependent_template_p): Handle OVERLOADs.
	PR c++/13310
	* g++.dg/template/crash15.C: New test.


Comment 4 Mark Mitchell 2003-12-15 21:56:16 UTC
Fixed in GCC 3.4.