Bug 22352 - [3.4 Regression] ICE in lookup_member
Summary: [3.4 Regression] ICE in lookup_member
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 3.4.6
Assignee: Volker Reichelt
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: ice-on-valid-code, monitored, patch
Depends on:
Blocks:
 
Reported: 2005-07-07 18:11 UTC by Andrew Pinski
Modified: 2005-12-05 18:01 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-10 03:14:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-07-07 18:11:04 UTC
template <class A>
class s
{
  typedef int d;
  template <class s, typename s::d>
    friend class t;
};

s<int> t1;
Comment 1 Andrew Pinski 2005-07-11 05:48:30 UTC
Confirmed.
Comment 2 Andrew Pinski 2005-09-12 20:49:19 UTC
: Search converges between 2003-10-17-trunk (#379) and 2003-10-18-trunk (#380).
Comment 3 janis187 2005-09-28 16:41:09 UTC
A regression hunt identified this patch from lerdsuwa@gcc.gnu.org:

  http://gcc.gnu.org/ml/gcc-cvs/2003-10/msg00694.html
Comment 4 GCC Commits 2005-10-13 08:36:49 UTC
Subject: Bug 22352

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	mmitchel@gcc.gnu.org	2005-10-13 08:36:38

Modified files:
	gcc/cp         : call.c decl.c pt.c semantics.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: friend5.C 
	gcc/testsuite/g++.dg/template: crash38.C crash39.C crash40.C 
	                               crash41.C friend38.C 

Log message:
	PR c++/22464
	* semantics.c (finish_id_expression): Issue errors about uses of
	local variables in containing functions even in templates.
	PR c++/22180
	* call.c (build_new_method_call): Correct pretty-printing of
	destructor names.
	* pt.c (tsubst_qualified_id): Recognize invalid uses of "~T" as an
	identifier.
	PR c++/23694
	* decl.c (start_method): Return error_mark_node for errors.
	PR c++/23307
	* pt.c (push_template_decl_real): Complain about attempts to
	declare template variables.
	PR c++/22352
	* pt.c (tsubst_template_parms): Set processing_template_decl while
	processing the parameters.
	(tsubst_decl): Set processing_template_decl when substituting into
	a TEMPLATE_DECL.
	PR c++/22405
	* pt.c (most_specialized_instantiation): Robustify.
	PR c++/22464
	* g++.dg/template/crash/41.C: New test.
	PR c++/22180
	* g++.dg/template/crash40.C: New test.
	PR c++/23694
	* g++.dg/parse/friend5.C: New test.
	
	PR c++/23307
	* g++.dg/template/crash38.C: New test.
	
	PR c++/22352
	* g++.dg/template/friend38.C: New test.
	
	PR c++/22405
	* g++.dg/template/crash39.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.531.2.11&r2=1.531.2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1371.2.25&r2=1.1371.2.26
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.978.2.31&r2=1.978.2.32
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.463.2.11&r2=1.463.2.12
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.129&r2=1.4648.2.130
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/friend5.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash38.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash39.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash40.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash41.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/friend38.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.451&r2=1.5084.2.452

Comment 5 GCC Commits 2005-10-13 08:38:50 UTC
Subject: Bug 22352

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2005-10-13 08:38:41

Modified files:
	gcc/cp         : call.c decl.c pt.c semantics.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/parse: friend5.C 
	gcc/testsuite/g++.dg/template: crash38.C crash39.C crash40.C 
	                               crash41.C friend38.C 

Log message:
	PR c++/22464
	* semantics.c (finish_id_expression): Issue errors about uses of
	local variables in containing functions even in templates.
	PR c++/22180
	* call.c (build_new_method_call): Correct pretty-printing of
	destructor names.
	* pt.c (tsubst_qualified_id): Recognize invalid uses of "~T" as an
	identifier.
	PR c++/23694
	* decl.c (start_method): Return error_mark_node for errors.
	PR c++/23307
	* pt.c (push_template_decl_real): Complain about attempts to
	declare template variables.
	PR c++/22352
	* pt.c (tsubst_template_parms): Set processing_template_decl while
	processing the parameters.
	(tsubst_decl): Set processing_template_decl when substituting into
	a TEMPLATE_DECL.
	PR c++/22405
	* pt.c (most_specialized_instantiation): Robustify.
	PR c++/22464
	* g++.dg/template/crash/41.C: New test.
	PR c++/22180
	* g++.dg/template/crash40.C: New test.
	PR c++/23694
	* g++.dg/parse/friend5.C: New test.
	
	PR c++/23307
	* g++.dg/template/crash38.C: New test.
	
	PR c++/22352
	* g++.dg/template/friend38.C: New test.
	
	PR c++/22405
	* g++.dg/template/crash39.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/call.c.diff?cvsroot=gcc&r1=1.557&r2=1.558
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1432&r2=1.1433
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.1045&r2=1.1046
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/semantics.c.diff?cvsroot=gcc&r1=1.491&r2=1.492
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4928&r2=1.4929
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/parse/friend5.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash38.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash39.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash40.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/crash41.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/friend38.C.diff?cvsroot=gcc&r1=1.1&r2=1.2
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6186&r2=1.6187

Comment 6 Mark Mitchell 2005-10-13 08:40:15 UTC
Fixed in 4.0.3.
Comment 7 Nathan Sidwell 2005-10-13 13:17:19 UTC
could probably backport to 3.4
Comment 8 Volker Reichelt 2005-12-05 17:16:10 UTC
Taking care of the backport.
Comment 9 Volker Reichelt 2005-12-05 18:01:09 UTC
Subject: Bug 22352

Author: reichelt
Date: Mon Dec  5 18:01:05 2005
New Revision: 108066

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108066
Log:
	Backport:
	2005-10-13  Mark Mitchell  <mark@codesourcery.com>

	PR c++/22352
	* pt.c (tsubst_template_parms): Set processing_template_decl while
	processing the parameters.
	(tsubst_decl): Set processing_template_decl when substituting into
	a TEMPLATE_DECL.

	* g++.dg/template/friend38.C: New test.

Added:
    branches/gcc-3_4-branch/gcc/testsuite/g++.dg/template/friend38.C
Modified:
    branches/gcc-3_4-branch/gcc/cp/ChangeLog
    branches/gcc-3_4-branch/gcc/cp/pt.c
    branches/gcc-3_4-branch/gcc/testsuite/ChangeLog

Comment 10 Volker Reichelt 2005-12-05 18:01:41 UTC
Now also fixed on the 3.4 branch.