The following invalid code snippet triggers an ICE on mainline and 4.2 branch: =========================================================== template<void> struct A { template<int> friend void foo(); }; void bar() { foo<0>(); } =========================================================== bug.cc:1: error: 'void' is not a valid type for a template constant parameter bug.cc: In function 'void bar()': bug.cc:8: internal compiler error: in retrieve_specialization, at cp/pt.c:856 Please submit a full bug report, [etc.]
Will not be fixed in 4.2.0; retargeting at 4.2.1.
Hi again... A regression hunt would be useful for this one too...
A regression hunt on powerpc-linux using the submitter's test case identified the following patch: http://gcc.gnu.org/viewcvs?view=rev&rev=115800 r115800 | lmillward | 2006-07-28 17:01:19 +0000 (Fri, 28 Jul 2006) (By the way, I think regression hunts are fun and don't mind doing them. They usually take very little effort.)
Great Janis, I will ask your help more often: hunts are very helpful for quickly fixing recent bugs!
Seems due to a trivial thinko in the changes for 27668, 27962, etc..
Patch at: http://gcc.gnu.org/ml/gcc-patches/2007-09/msg01933.html
NB: the patch also fixes PR30299
NB: the patch also fixes PR28639
Change target milestone to 4.2.3, as 4.2.2 has been released.
Subject: Bug 31446 Author: paolo Date: Tue Oct 16 22:21:59 2007 New Revision: 129391 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129391 Log: /cp 2007-10-16 Paolo Carlini <pcarlini@suse.de> PR c++/31446 * pt.c (current_template_args): Do not change TREE_LIST elements with a TREE_VALUE of error_mark_node. /testsuite 2007-10-16 Paolo Carlini <pcarlini@suse.de> PR c++/31446 * g++.dg/template/void11.C: New. * g++.dg/template/void2.C: Adjust error markers. * g++.dg/template/void10.C: Likewise. * g++.dg/template/crash55.C: Likewise. Added: trunk/gcc/testsuite/g++.dg/template/void11.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/template/crash55.C trunk/gcc/testsuite/g++.dg/template/void10.C trunk/gcc/testsuite/g++.dg/template/void2.C
4.2.3 is being released now, changing milestones of open bugs to 4.2.4.
4.2.4 is being released, changing milestones to 4.2.5.
Closing 4.2 branch, fixed in 4.3.