Bug 27398 - [4.0/4.1/4.2 regression] ICE on missing closing parenthesis
Summary: [4.0/4.1/4.2 regression] ICE on missing closing parenthesis
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.2.0
: P3 normal
Target Milestone: 4.2.0
Assignee: Volker Reichelt
URL: http://gcc.gnu.org/ml/gcc-patches/200...
Keywords: error-recovery, ice-on-invalid-code, monitored, patch
Depends on:
Blocks:
 
Reported: 2006-05-02 19:23 UTC by Volker Reichelt
Modified: 2006-08-25 22:46 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.2.0
Known to fail: 4.1.1 4.0.4
Last reconfirmed: 2006-05-03 16:01:23


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2006-05-02 19:23:47 UTC
The following code snippet causes an ICE since GCC 3.4.0:

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

bug.cc:3: error: expected primary-expression before ';' token
bug.cc:3: error: ISO C++ forbids initialization of member 'foo'
bug.cc:3: error: making 'foo' static
bug.cc:3: error: invalid in-class initialization of static data member of non-integral type 'void*'
bug.cc:3: internal compiler error: tree check: expected tree that contains 'decl minimal' structure, have 'void_type'  in cp_finish_decl, at cp/decl.c:5027
Please submit a full bug report, [etc.]
Comment 1 Wolfgang Bangerth 2006-05-03 16:01:23 UTC
Confirmed.
Comment 2 patchapp@dberlin.org 2006-05-18 20:05:13 UTC
Subject: Bug number PR c++/27398

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-05/msg00943.html
Comment 3 Volker Reichelt 2006-05-21 08:39:23 UTC
Subject: Bug 27398

Author: reichelt
Date: Sun May 21 08:39:14 2006
New Revision: 113950

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113950
Log:
	PR c++/27398
	* decl.c (grokdeclarator): Return error_mark_node instead of NULL_TREE
	or void_type_node.

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

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

Comment 4 Volker Reichelt 2006-05-21 08:41:45 UTC
Fixed on mainline.
Comment 5 patchapp@dberlin.org 2006-08-03 20:15:23 UTC
Subject: Bug number PR c++/27398

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00075.html
Comment 6 Volker Reichelt 2006-08-25 22:46:55 UTC
Backporting the patch to the branches was considered to risky, see
http://gcc.gnu.org/ml/gcc-patches/2006-08/msg00804.html
So closing as fixed on mainline.