Bug 29730 - [4.0 regression] ICE on invalid declaration of template member
Summary: [4.0 regression] ICE on invalid declaration of template member
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P2 normal
Target Milestone: 4.1.2
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-invalid-code, monitored
: 31026 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-11-05 20:35 UTC by Volker Reichelt
Modified: 2007-03-10 21:18 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.1.2 4.2.0 4.3.0
Known to fail: 4.1.1
Last reconfirmed: 2006-11-26 00:20:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-11-05 20:35:48 UTC
The following invalid code snippet triggers an ICE since GCC 4.0.0:

=================================================
struct A
{
  template<int> void foo()(0);
};
=================================================

bug.cc:3: internal compiler error: in grokfield, at cp/decl2.c:846
Please submit a full bug report, [etc.]
Comment 1 Andrew Pinski 2006-11-26 00:20:39 UTC
Confirmed.
Comment 2 Mark Mitchell 2006-12-06 22:55:08 UTC
Subject: Bug 29730

Author: mmitchel
Date: Wed Dec  6 22:54:51 2006
New Revision: 119601

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119601
Log:
	PR c++/29730
	* parser.c (cp_parser_init_declarator): Reject initialization of
	functions.
	PR c++/29730
	* g++.dg/template/crash64.C: New test.
	* g++.dg/parse/crash27.C: Adjust error markers.

Added:
    trunk/gcc/testsuite/g++.dg/template/crash64.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/parse/crash27.C

Comment 3 Mark Mitchell 2006-12-06 22:55:29 UTC
Fixed in 4.3.0.
Comment 4 Mark Mitchell 2006-12-07 17:49:48 UTC
Subject: Bug 29730

Author: mmitchel
Date: Thu Dec  7 17:49:32 2006
New Revision: 119631

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119631
Log:
	PR c++/29730
	* parser.c (cp_parser_init_declarator): Reject initialization of
	functions.

	PR c++/29730
	* g++.dg/template/crash64.C: New test.
	* g++.dg/parse/crash27.C: Adjust error markers.

Added:
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/crash64.C
Modified:
    branches/gcc-4_1-branch/gcc/cp/ChangeLog
    branches/gcc-4_1-branch/gcc/cp/parser.c
    branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_1-branch/gcc/testsuite/g++.dg/parse/crash27.C

Comment 5 Mark Mitchell 2006-12-07 18:08:52 UTC
Subject: Bug 29730

Author: mmitchel
Date: Thu Dec  7 18:08:42 2006
New Revision: 119632

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119632
Log:
	PR c++/29730
	* parser.c (cp_parser_init_declarator): Reject initialization of
	functions.
	PR c++/29730
	* g++.dg/template/crash64.C: New test.
	* g++.dg/parse/crash27.C: Adjust error markers.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/crash64.C
Modified:
    branches/gcc-4_2-branch/gcc/cp/ChangeLog
    branches/gcc-4_2-branch/gcc/cp/parser.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/parse/crash27.C

Comment 6 Mark Mitchell 2006-12-07 18:09:11 UTC
Fixed in 4.1.2, 4.2.0.
Comment 7 Gabriel Dos Reis 2007-02-03 20:50:51 UTC
Fixed in GCC-4.1.2.
Comment 8 Volker Reichelt 2007-03-10 21:18:29 UTC
*** Bug 31026 has been marked as a duplicate of this bug. ***