Playing around with 13306, I find this: ------------------------ template <typename> struct A { template <typename> void g() {} }; template <typename> void f() { A<int> a; a.f<double>(); } ------------------------- 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 x.cc x.cc: In function `void f()': x.cc:7: 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. W.
This ICE without checking: pr13310.cc: In function `void f()': pr13310.cc:7: internal compiler error: in lookup_member, at cp/search.c:1228 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Here's an even simpler testcase: =============================== struct A {}; template <typename> void foo() { A a; a.foo<int>(); } ===============================
Subject: Bug 13310 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 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. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3803&r2=1.3804 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.802&r2=1.803 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3257&r2=1.3258 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash15.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed in GCC 3.4.