Bug 58061 - typedef in member's derived class causes crash when a class with the same name exists in the base class
typedef in member's derived class causes crash when a class with the same nam...
Product: Red Hat Linux
Classification: Retired
Component: gcc3 (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2002-01-07 10:15 EST by Arnold HEndriks
Modified: 2007-04-18 12:38 EDT (History)
1 user (show)

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

Attachments (Terms of Use)

  None (edit)
Description Arnold HEndriks 2002-01-07 10:15:39 EST
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 14:03:17 EST
Confirmed still present in 8.0
Comment 2 Richard Henderson 2004-10-02 14:18:30 EDT
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.