Bug 32113 - [4.1/4.2/4.3 regression] ICE with invalid template parameter
Summary: [4.1/4.2/4.3 regression] ICE with invalid template parameter
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P2 normal
Target Milestone: 4.1.3
Assignee: Paolo Carlini
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2007-05-27 22:08 UTC by Volker Reichelt
Modified: 2007-08-31 09:58 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-08-29 10:19:41


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-05-27 22:08:50 UTC
The following invalid code snippet triggers an ICE since GCC 4.1.0:

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

template<typename T> void foo (A<&T::template i>);

template void foo<A<0> > (A<0>);
=====================================================

bug.cc:3: error: '#'unbound_class_template' not supported by dump_decl#<declaration error>' is not a template
bug.cc:5: internal compiler error: in lookup_member, at cp/search.c:1203
Please submit a full bug report, [etc.]

Btw, the hosed diagnostic in the first line of the error message is tracked
in PR 32112.
Comment 1 paolo@gcc.gnu.org 2007-08-31 09:45:08 UTC
Subject: Bug 32113

Author: paolo
Date: Fri Aug 31 09:44:54 2007
New Revision: 127963

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127963
Log:
/cp
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/32113
	* search.c (lookup_member): Check the name argument for
	error_mark_node.

/testsuite
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/32113
	* g++.dg/template/crash70.C: New.

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

Comment 2 paolo@gcc.gnu.org 2007-08-31 09:55:55 UTC
Subject: Bug 32113

Author: paolo
Date: Fri Aug 31 09:55:43 2007
New Revision: 127965

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127965
Log:
/cp
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/32113
	* search.c (lookup_member): Check the name argument for
	error_mark_node.

/testsuite
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/32113
	* g++.dg/template/crash70.C: New.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/crash70.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/search.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog

Comment 3 paolo@gcc.gnu.org 2007-08-31 09:58:01 UTC
Subject: Bug 32113

Author: paolo
Date: Fri Aug 31 09:57:50 2007
New Revision: 127966

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127966
Log:
/cp
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/32113
	* search.c (lookup_member): Check the name argument for
	error_mark_node.

/testsuite
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/32113
	* g++.dg/template/crash70.C: New.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/crash70.C
Modified:
    branches/gcc-4_2-branch/gcc/cp/ChangeLog
    branches/gcc-4_2-branch/gcc/cp/search.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog

Comment 4 Paolo Carlini 2007-08-31 09:58:31 UTC
Fixed.