Bug 10432 - [3.3/3.4 regression] ICE in poplevel, at cp/decl.c:1230
Summary: [3.3/3.4 regression] ICE in poplevel, at cp/decl.c:1230
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: 3.3.1
Assignee: Mark Mitchell
URL:
Keywords: error-recovery, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2003-04-18 16:36 UTC by Wolfgang Bangerth
Modified: 2004-01-17 04:22 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-06-02 10:18:45


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wolfgang Bangerth 2003-04-18 16:36:00 UTC
This ICEs:
----------------------
struct INCOMPLETE;
template <int> struct X {
    static INCOMPLETE value;
};
template <> INCOMPLETE X<1>::value = 0;
----------------------

mortar/laplace> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc
x.cc:5: error: variable `INCOMPLETE X<1>::value' has initializer but incomplete
   type
x.cc:5: internal compiler error: in poplevel, at cp/decl.c:1230


It ICEs since 3.0, but didn't before. Looks like just
another error recovery problem.

W.

Release:
unknown

Environment:
3.2, 3.3 and mainline
Comment 1 Volker Reichelt 2003-04-29 20:11:24 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed.
Comment 2 CVS Commits 2003-06-12 00:10:31 UTC
Subject: Bug 10432

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2003-06-12 00:10:27

Modified files:
	gcc/cp         : ChangeLog cp-tree.h decl.c semantics.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: error1.C 

Log message:
	PR c++/10432
	* cp-tree.h (finish_declarator): Remove.
	* decl.c (cp_finish_decl): Make sure to pop_nested_class even for
	erroneous declarations.
	* semantics.c (finish_declarator): Remove.
	
	PR c++/10432
	* g++.dg/parse/error1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3414&r2=1.3415
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.850&r2=1.851
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1063&r2=1.1064
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.308&r2=1.309
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2760&r2=1.2761
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 3 CVS Commits 2003-06-12 00:10:31 UTC
Subject: Bug 10432

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2003-06-12 00:10:27

Modified files:
	gcc/cp         : ChangeLog cp-tree.h decl.c semantics.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: error1.C 

Log message:
	PR c++/10432
	* cp-tree.h (finish_declarator): Remove.
	* decl.c (cp_finish_decl): Make sure to pop_nested_class even for
	erroneous declarations.
	* semantics.c (finish_declarator): Remove.
	
	PR c++/10432
	* g++.dg/parse/error1.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3414&r2=1.3415
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.850&r2=1.851
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1063&r2=1.1064
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.308&r2=1.309
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2760&r2=1.2761
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/error1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 4 Mark Mitchell 2003-06-12 03:14:32 UTC
Fixed with attached patch in GCC 3.4.

Will not be fixed in GCC 3.3.x because the crash only happens after a valid
error message has been issued.