Bug 33207

Summary: [4.3 regression] ICE redeclaring namespace as struct
Product: gcc Reporter: Volker Reichelt <reichelt>
Component: c++Assignee: Simon Martin <simartin>
Status: RESOLVED FIXED    
Severity: minor CC: fang, gcc-bugs, simartin
Priority: P4 Keywords: error-recovery, ice-on-invalid-code, monitored
Version: 4.3.0   
Target Milestone: 4.3.0   
Host: Target:
Build: Known to work: 4.0.2
Known to fail: 4.3.0 Last reconfirmed: 2007-09-05 18:32:00

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.