The following valid testcase is rejected on mainline and 4.3 branch: ================================================= template<int> struct A { template<int> void foo(); }; template<> template<int> void A<0>::foo() {} ================================================= The regression was introduced between 2008-02-12 and 2008-02-15. Paolo, this is probably fallout from your patch PR c++/28743 * pt.c (determine_specialization): In case of function templates, when the type of DECL does not match FN there is no match. The problem is related to PR14494.
Please double check, but I don't think it's my patch: I tried quickly reverting it and interestingly nothing changes: 28743 doesn't ICE and this one is rejected. It seems something new is going on in this area... Maybe Janis can help with a regression hunt.
Never mind, I did something wrong in my quick check. I can confirm it's my patch. I'll try to look a bit into it, but beyond reverting it, I cannot promise to be able to fix the present issue without regressing on 28743...
Even the extra error in nontype16.C is IMHO wrong.
Ok, I'm going to post a patch reverting completely the fix for 28743, and then we'll see...
For 4.3, guess ice-on-invalid is more acceptable than rejects-valid, unless we have a real fix RSN, though I'll let Jason/Mark to decide. We have everything else what I was waiting for on gcc-4_3-branch, so if we can get this resolved either way today, the rc can be released.
IMHO reverting the fix for PR28743 is the way to go (Paolo, you don't need approval for reverting a patch of your own).
Subject: Bug 35282 Author: paolo Date: Fri Feb 22 11:02:00 2008 New Revision: 132543 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132543 Log: /testsuite 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 * g++.dg/template/nontype17.C: Add. /cp 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 2008-02-14 Paolo Carlini <pcarlini@suse.de> PR c++/28743 * pt.c (determine_specialization): In case of function templates, when the type of DECL does not match FN there is no match. /testsuite 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 2008-02-14 Paolo Carlini <pcarlini@suse.de> PR c++/28743 * g++.dg/template/nontype17.C: New. * g++.dg/template/nontype16.C: Add error. Added: trunk/gcc/testsuite/g++.dg/template/nontype17.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/g++.dg/template/nontype16.C
Subject: Bug 35282 Author: paolo Date: Fri Feb 22 11:02:31 2008 New Revision: 132544 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132544 Log: /testsuite 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 * g++.dg/template/nontype17.C: Add. /cp 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 2008-02-14 Paolo Carlini <pcarlini@suse.de> PR c++/28743 * pt.c (determine_specialization): In case of function templates, when the type of DECL does not match FN there is no match. /testsuite 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 2008-02-14 Paolo Carlini <pcarlini@suse.de> PR c++/28743 * g++.dg/template/nontype17.C: New. * g++.dg/template/nontype16.C: Add error. Modified: branches/gcc-4_3-branch/gcc/cp/ChangeLog branches/gcc-4_3-branch/gcc/cp/pt.c branches/gcc-4_3-branch/gcc/testsuite/g++.dg/template/nontype16.C branches/gcc-4_3-branch/gcc/testsuite/g++.dg/template/nontype17.C
Subject: Bug 35282 Author: paolo Date: Fri Feb 22 11:03:17 2008 New Revision: 132545 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132545 Log: /testsuite 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 * g++.dg/template/nontype17.C: Add. /cp 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 2008-02-14 Paolo Carlini <pcarlini@suse.de> PR c++/28743 * pt.c (determine_specialization): In case of function templates, when the type of DECL does not match FN there is no match. /testsuite 2008-02-22 Paolo Carlini <pcarlini@suse.de> PR c++/35282 Revert: 2008-02-14 Paolo Carlini <pcarlini@suse.de> PR c++/28743 * g++.dg/template/nontype17.C: New. * g++.dg/template/nontype16.C: Add error. Modified: branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed.