When I compile the reduced testcase below *with -g*, I get: $ g++ -g example_valuelist.ii example_valuelist.ii:5: internal compiler error: in tsubst, at cp/pt.c:9289 Without -g, it is accepted. With 3.4.1, the code worked w and w/ -g. template <class T> struct valuelist_types { struct null { }; template <T V, class next=null> struct list { }; }; template <unsigned D> void foo() { typename valuelist_types<unsigned>::template list<D> v; } void bar() { valuelist_types<unsigned>::list<2> v; }
I forgot to mention that the ICE disappears when I remove *either* the function template foo, or the function bar.
Confirmed. The bug apeeared between 2009-03-28 and 2009-04-24.
It was introduced revision 145565 and 145569.
It is caused by revision 145566: http://gcc.gnu.org/ml/gcc-cvs/2009-04/msg00188.html
Subject: Bug 40274 Author: jason Date: Mon Jun 29 23:15:43 2009 New Revision: 149066 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149066 Log: PR c++/40274 * error.c (dump_template_parms): Pass all args to count_non_default_template_args. (count_non_default_template_args): Pull out the inner ones. Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/error.c
Subject: Bug 40274 Author: jason Date: Mon Jun 29 23:18:46 2009 New Revision: 149067 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149067 Log: PR c++/40274 * error.c (dump_template_parms): Pass all args to count_non_default_template_args. (count_non_default_template_args): Pull out the inner ones. Added: trunk/gcc/testsuite/g++.dg/template/debug1.C Modified: trunk/gcc/testsuite/ChangeLog
Fixed.
Subject: Bug 40274 Author: hjl Date: Tue Jun 30 13:55:43 2009 New Revision: 149097 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149097 Log: 2009-06-30 H.J. Lu <hongjiu.lu@intel.com> Backport from mainline: 2009-06-30 Martin Jambor <mjambor@suse.cz> PR tree-optimization/40582 * gcc.c-torture/compile/pr40582.c: New test. 2009-06-29 Jason Merrill <jason@redhat.com> PR c++/40274 * g++.dg/template/debug1.C: New. 2009-06-25 Martin Jambor <mjambor@suse.cz> PR tree-optimization/40493 * gcc.c-torture/execute/pr40493.c: New test. Added: branches/gcc-4_4-branch/gcc/testsuite/g++.dg/template/debug1.C - copied unchanged from r149095, trunk/gcc/testsuite/g++.dg/template/debug1.C branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/compile/pr40582.c - copied unchanged from r149095, trunk/gcc/testsuite/gcc.c-torture/compile/pr40582.c branches/gcc-4_4-branch/gcc/testsuite/gcc.c-torture/execute/pr40493.c - copied unchanged from r149096, trunk/gcc/testsuite/gcc.c-torture/execute/pr40493.c Modified: branches/gcc-4_4-branch/gcc/testsuite/ChangeLog