Bug 37650 - [4.3 regression] ICE with broken default template parameter
Summary: [4.3 regression] ICE with broken default template parameter
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P4 minor
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2008-09-25 07:13 UTC by Volker Reichelt
Modified: 2009-04-22 15:29 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.3.6 4.4.0
Known to fail: 4.0.1 4.3.3
Last reconfirmed: 2008-09-28 19:43:57


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2008-09-25 07:13:41 UTC
The following invalid code snippet triggers an ICE since GCC 3.4.0:

=========================================================
template<int> struct A {};

template<typename = class A<0>: > struct B {};
=========================================================

bug.cc:3: error: an explicit specialization must be preceded by 'template <>'
bug.cc:3: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
Comment 1 Andrew Pinski 2008-09-28 19:43:57 UTC
Confirmed.
Comment 2 Paolo Carlini 2008-10-12 16:16:43 UTC
On it.
Comment 3 paolo@gcc.gnu.org 2008-10-14 17:53:18 UTC
Subject: Bug 37650

Author: paolo
Date: Tue Oct 14 17:51:55 2008
New Revision: 141115

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141115
Log:
/cp
2008-10-14  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/37650
	* pt.c (push_template_decl_real): Check that current_template_parms
	is not null.
	(process_partial_specialization): Assert current_template_parms not
	null.

/testsuite
2008-10-14  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/37650
	* g++.dg/template/crash83.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/template/crash83.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Paolo Carlini 2008-10-14 17:53:40 UTC
Fixed for 4.4.0.
Comment 5 Joseph S. Myers 2009-03-31 20:58:25 UTC
Closing 4.2 branch.
Comment 6 Richard Biener 2009-04-22 15:29:05 UTC
WONTFIX for 4.3.