Bug 33207 - [4.3 regression] ICE redeclaring namespace as struct
Summary: [4.3 regression] ICE redeclaring namespace as struct
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P4 minor
Target Milestone: 4.3.0
Assignee: Simon Martin
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2007-08-27 21:29 UTC by Volker Reichelt
Modified: 2007-09-25 18:41 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.0.2
Known to fail: 4.3.0
Last reconfirmed: 2007-09-05 18:32:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-08-27 21:29:53 UTC
The following invalid code snippet triggers an ICE on mainline
(it was wrongly accepted before):

====================
namespace N { }
struct N;
struct N* p;
====================

bug.cc:2: error: 'struct N' redeclared as different kind of symbol
bug.cc:1: error: previous declaration of 'namespace N { }'
bug.cc:3: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
Comment 1 Andrew Pinski 2007-09-01 19:57:15 UTC
Confirmed.
Comment 2 Simon Martin 2007-09-05 18:32:00 UTC
I'm testing a patch for this one.
Comment 3 patchapp@dberlin.org 2007-09-08 05:55:20 UTC
Subject: Bug number PR c++/33207

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/2007-09/msg00667.html
Comment 4 Simon Martin 2007-09-25 18:34:16 UTC
Subject: Bug 33207

Author: simartin
Date: Tue Sep 25 18:34:05 2007
New Revision: 128769

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128769
Log:
gcc/cp/

2007-09-25  Simon Martin  <simartin@users.sourceforge.net>
        
	PR c++/33207
	* name-lookup.c (pushtag): Do not create an implicit typedef before
	the associated type declaration is known to be valid.

gcc/testsuite/

2007-09-25  Simon Martin  <simartin@users.sourceforge.net>

	PR c++/33207
	* g++.dg/parse/crash38.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/parse/crash38.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/name-lookup.c
    trunk/gcc/testsuite/ChangeLog

Comment 5 Simon Martin 2007-09-25 18:41:51 UTC
Fixed on the mainline.