Bug 34603 - [4.2 regression] ICE with broken template declaration
Summary: [4.2 regression] ICE with broken template declaration
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P4 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2007-12-28 02:36 UTC by Volker Reichelt
Modified: 2009-03-31 14:57 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.3.0
Known to fail: 4.2.5
Last reconfirmed: 2008-01-13 02:25:22


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-12-28 02:36:37 UTC
The following invalid testcase triggers an ICE since GCC 4.0.0:

========================================
template<typename> struct A;

template<typename T> A<T>::A( struct A;
========================================

bug.cc:3: error: template definition of non-template 'struct A< <template-parameter-1-1> >::A'
bug.cc:3: internal compiler error: in push_class_level_binding, at cp/name-lookup.c:2659
Please submit a full bug report, [etc.]
Comment 1 Wolfgang Bangerth 2008-01-13 02:25:22 UTC
Confirmed.
Comment 2 Paolo Carlini 2008-01-24 10:58:06 UTC
On it.
Comment 3 andreasmeier80 2008-01-24 18:42:47 UTC
Patch at http://gcc.gnu.org/ml/gcc-patches/2008-01/msg01138.html
Comment 4 paolo@gcc.gnu.org 2008-01-24 19:54:59 UTC
Subject: Bug 34603

Author: paolo
Date: Thu Jan 24 19:54:11 2008
New Revision: 131804

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131804
Log:
/cp
2008-01-24  Paolo Carlini  <pcarlini@suse.de>

        PR c++/34603
        * pt.c (push_template_decl_real): Return error_mark_node in case
	of template definition of non-template.

/testsuite
2008-01-24  Paolo Carlini  <pcarlini@suse.de>

        PR c++/34603
        * g++.dg/template/crash77.C: New.

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

Comment 5 Paolo Carlini 2008-01-24 19:58:23 UTC
Fixed for 4.3.0.
Comment 6 Joseph S. Myers 2008-07-04 22:27:23 UTC
Closing 4.1 branch.
Comment 7 Joseph S. Myers 2009-03-31 14:57:39 UTC
Closing 4.2 branch, fixed in 4.3.