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...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc3
Version: 8.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
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:
Clone Of:
Environment:
Last Closed: 2004-10-02 18:18:30 UTC
Embargoed:


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++
gcc-c++-2.96-98
arnold@bunny:~/develop $ rpm -q gcc3-c++
gcc3-c++-3.0.1-3

How reproducible:
Always

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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17795


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