Bug 35282 - [4.3/4.4 regression] Template specialization rejected
Summary: [4.3/4.4 regression] Template specialization rejected
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P1 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: monitored, rejects-valid
Depends on:
Blocks: 14494
  Show dependency treegraph
 
Reported: 2008-02-21 21:26 UTC by Volker Reichelt
Modified: 2008-03-22 23:04 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-02-21 23:13:46


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2008-02-21 21:26:36 UTC
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.
Comment 1 Paolo Carlini 2008-02-21 22:25:37 UTC
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.
Comment 2 Paolo Carlini 2008-02-21 23:13:46 UTC
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...
Comment 3 Jakub Jelinek 2008-02-22 09:41:21 UTC
Even the extra error in nontype16.C is IMHO wrong.
Comment 4 Paolo Carlini 2008-02-22 09:48:43 UTC
Ok, I'm going to post a patch reverting completely the fix for 28743, and then we'll see...
Comment 5 Jakub Jelinek 2008-02-22 09:51:52 UTC
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.
Comment 6 Richard Biener 2008-02-22 10:44:22 UTC
IMHO reverting the fix for PR28743 is the way to go (Paolo, you don't need
approval for reverting a patch of your own).
Comment 7 paolo@gcc.gnu.org 2008-02-22 11:02:48 UTC
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

Comment 8 paolo@gcc.gnu.org 2008-02-22 11:03:25 UTC
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

Comment 9 paolo@gcc.gnu.org 2008-02-22 11:04:10 UTC
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

Comment 10 Paolo Carlini 2008-02-22 11:05:26 UTC
Fixed.