Bug 25300 - [4.1/4.2 regression] ICE with g++.dg/template/inherit.C
Summary: [4.1/4.2 regression] ICE with g++.dg/template/inherit.C
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.1.0
Assignee: Mark Mitchell
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2005-12-07 20:05 UTC by Volker Reichelt
Modified: 2005-12-12 16:32 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-12-07 20:06:48


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2005-12-07 20:05:08 UTC
The testcase g++.dg/template/inherit.C causes an ICE on the 4.1 branch
and mainline:

=====================================================
template<typename T>
struct X { void f() { } };

struct Z : X<int> { };

int main()
{
  Z z;
  z.X::f();  // { dg-error ".*" "" }
}
=====================================================

inherit.C: In function 'int main()':
inherit.C:9: error: 'template<class T> struct X' used without template parameters
inherit.C:9: internal compiler error: in finish_class_member_access_expr, at cp/typeck.c:1996
Please submit a full bug report, [etc.]

Because of the catch-all marker { dg-error ".*" "" } the testcase still
PASSes despite the ICE.
That means, that the testcase should also be fixed

Btw, this is the only ICE I found in the logfiles for 4.1 and 4.2
(and also 4.0) that wasn't flagged.
Comment 1 Andrew Pinski 2005-12-07 20:06:48 UTC
Confirmed.
Comment 2 Volker Reichelt 2005-12-09 17:48:26 UTC
Mark, the ICE appeared with your patch for PR20293:
http://gcc.gnu.org/ml/gcc-cvs/2005-11/msg00580.html
Comment 3 Mark Mitchell 2005-12-12 16:29:47 UTC
Subject: Bug 25300

Author: mmitchel
Date: Mon Dec 12 16:29:44 2005
New Revision: 108413

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108413
Log:
	PR c++/25300
	* tree.c (build_qualified_name): Return error_mark_node for
	erroneous input.
	PR c++/25300
	* g++.dg/template/inherit.C: Do not use a generic error message.

Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/tree.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/template/inherit.C

Comment 4 Mark Mitchell 2005-12-12 16:30:28 UTC
Subject: Bug 25300

Author: mmitchel
Date: Mon Dec 12 16:30:24 2005
New Revision: 108414

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108414
Log:
	PR c++/25300
	* tree.c (build_qualified_name): Return error_mark_node for
	erroneous input.
	PR c++/25300
	* g++.dg/template/inherit.C: Do not use a generic error message.

Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/tree.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/inherit.C

Comment 5 Mark Mitchell 2005-12-12 16:32:23 UTC
Fixed in 4.1.