Bug 58061 - typedef in member's derived class causes crash when a class with the same name exists in the base class
Summary: typedef in member's derived class causes crash when a class with the same nam...
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc3   
(Show other bugs)
Version: 8.0
Hardware: i686 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2002-01-07 15:15 UTC by Arnold HEndriks
Modified: 2007-04-18 16:38 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-10-02 18:18:30 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Arnold HEndriks 2002-01-07 15:15:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)

Description of problem:
When class X has a (member) subclass that created a typedef, and this typedef 
has the same name as a class inside the base class of class X,
g++3 and g++ crash with an internal error

Version-Release number of selected component (if applicable):
arnold@bunny:~/develop $ rpm -q gcc-c++
arnold@bunny:~/develop $ rpm -q gcc3-c++

How reproducible:

Code to Reproduce:
struct Base
        class AutoReadLock { };
struct Standalone
        class AutoLock { };
        typedef AutoLock AutoReadLock;
struct Derived : Base
        struct LocalMember : public Standalone { };
        class AutoReadLock { };

Actual Results:  arnold@bunny:~/develop $ g++3 test.C
test.C:14: Internal compiler error in pop_binding, at cp/decl.c:1193

Expected Results:  An error at link time (because of the lack of main()), but no
compile time crash

Additional info:

Renaming the typedefs fixes the problem

Comment 1 Alan Cox 2002-12-15 19:03:17 UTC
Confirmed still present in 8.0

Comment 2 Richard Henderson 2004-10-02 18:18:30 UTC
Present in all versions up through 3.4; fixed in 4.0.  Pushed upstream to

Note You need to log in before you can comment on or make changes to this bug.