Bug 10446 - [3.2 regression] ICE on a definition of a nonexistent member function of a nested class in a class template
Summary: [3.2 regression] ICE on a definition of a nonexistent member function of a ne...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.0
: P3 normal
Target Milestone: 3.4.0
Assignee: Mark Mitchell
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2003-04-21 02:26 UTC by kparz
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

See Also:
Host: i386-unknown-freebsd4.8
Target: i386-unknown-freebsd4.8
Build: i386-unknown-freebsd4.8
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kparz 2003-04-21 02:26:01 UTC
Attempt to provide an out-of-class definition of a nonexistent member function of a class nested in a class template causes an ICE.  An ICE also occurs if the definition of the nested class `I' is removed.

Release:
3.4 20030419 (experimental)

Environment:
System: FreeBSD arcturus.student.iastate.edu 4.8-STABLE FreeBSD 4.8-STABLE #24: Mon Apr 14 21:37:07 CDT 2003 kparz@arcturus.student.iastate.edu:/usr/obj/usr/src/sys/ARCTURUS i386


	
host: i386-unknown-freebsd4.8
build: i386-unknown-freebsd4.8
target: i386-unknown-freebsd4.8
configured with: ../gcc/configure --prefix=/u/gcc-20030419 --enable-languages=c,c++,f77

How-To-Repeat:
template <class T> struct L { struct I {}; };
template <class T> void L<T>::I::foo() {}
Comment 2 Wolfgang Bangerth 2003-04-21 15:28:02 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: Confirmed. A regression since 3.0 w.r.t 2.95
Comment 3 Giovanni Bajo 2003-04-21 16:26:49 UTC
From: "Giovanni Bajo" <giovannibajo@libero.it>
To: <gcc-gnats@gcc.gnu.org>,
	<kparz@iastate.edu>,
	<gcc-bugs@gcc.gnu.org>,
	<nobody@gcc.gnu.org>,
	<gcc-prs@gcc.gnu.org>
Cc:  
Subject: Re: c++/10446: ICE on a definition of a nonexistent member function of a nested class in a class template
Date: Mon, 21 Apr 2003 16:26:49 +0200

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&p
 r=10446
 
 Confirmed. It's an ICE on error recovery, present on 3.2/3.3/3.4. I rate
 this as a regression since 2.95 was correctly recovering.
 
 Giovanni Bajo
 
Comment 4 Mark Mitchell 2003-04-22 21:18:15 UTC
Responsible-Changed-From-To: unassigned->mmitchel
Responsible-Changed-Why: Working on a fix.
Comment 5 Mark Mitchell 2003-04-22 22:53:02 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10446
Date: 22 Apr 2003 22:53:02 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	mmitchel@gcc.gnu.org	2003-04-22 22:53:01
 
 Modified files:
 	gcc/cp         : ChangeLog search.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: crash3.C 
 
 Log message:
 	PR c++/10446
 	* search.c (lookup_fnfields_1): Handle empty slots in the method
 	vector.
 	
 	PR c++/10446
 	* g++.dg/parse/crash3.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3335&r2=1.3336
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&r1=1.259&r2=1.260
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2614&r2=1.2615
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 

Comment 6 Mark Mitchell 2003-04-22 22:53:02 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10446
Date: 22 Apr 2003 22:53:02 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	mmitchel@gcc.gnu.org	2003-04-22 22:53:01
 
 Modified files:
 	gcc/cp         : ChangeLog search.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: crash3.C 
 
 Log message:
 	PR c++/10446
 	* search.c (lookup_fnfields_1): Handle empty slots in the method
 	vector.
 	
 	PR c++/10446
 	* g++.dg/parse/crash3.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3335&r2=1.3336
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&r1=1.259&r2=1.260
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2614&r2=1.2615
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash3.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
 

Comment 7 Mark Mitchell 2003-04-22 22:57:05 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10446
Date: 22 Apr 2003 22:57:05 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	mmitchel@gcc.gnu.org	2003-04-22 22:57:05
 
 Modified files:
 	gcc/cp         : ChangeLog search.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: crash3.C 
 
 Log message:
 	PR c++/10446
 	* search.c (lookup_fnfields_1): Handle empty slots in the method
 	vector.
 	
 	PR c++/10446
 	* g++.dg/parse/crash3.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.112&r2=1.3076.2.113
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.243.2.5&r2=1.243.2.6
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.147&r2=1.2261.2.148
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
 

Comment 8 Mark Mitchell 2003-04-22 22:57:05 UTC
From: mmitchel@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: c++/10446
Date: 22 Apr 2003 22:57:05 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Branch: 	gcc-3_3-branch
 Changes by:	mmitchel@gcc.gnu.org	2003-04-22 22:57:05
 
 Modified files:
 	gcc/cp         : ChangeLog search.c 
 	gcc/testsuite  : ChangeLog 
 Added files:
 	gcc/testsuite/g++.dg/parse: crash3.C 
 
 Log message:
 	PR c++/10446
 	* search.c (lookup_fnfields_1): Handle empty slots in the method
 	vector.
 	
 	PR c++/10446
 	* g++.dg/parse/crash3.C: New test.
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.112&r2=1.3076.2.113
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.243.2.5&r2=1.243.2.6
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.147&r2=1.2261.2.148
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/crash3.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
 
Comment 9 Joe Buck 2003-04-25 19:28:52 UTC
State-Changed-From-To: analyzed->closed
State-Changed-Why: No longer present on any branch or trunk