c++/8727: compiler confused by inheritance from an anonymous struct

jbuck@synopsys.com jbuck@synopsys.com
Tue Nov 26 17:40:00 GMT 2002

>Number:         8727
>Category:       c++
>Synopsis:       compiler confused by inheritance from an anonymous struct
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          rejects-legal
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 26 17:26:00 PST 2002
>Originator:     Joe Buck
>Release:        3.2.1
This bug was reported by
jelenz@students.wisc.edu (John Lenz).

Attempting to inherit from a typedef'd anonymous struct seems
to confuse gcc (possibly in the generation of typeinfo or
virtual function tables).  The example given here works
with gcc-2.95.x and Red Hat's gcc 2.96, but fails with
gcc 3.0.x through gcc 3.2.1.
gcc -c bb.cxx
bb.cxx:10: redefinition of `const char _ZTS4Heya[6]'
bb.cxx:10: `const char _ZTS4Heya[6]' previously defined here
Of course we can work around this by avoiding the anonymous
struct, so it's non-critical, even if it is a regression.
Content-Type: application/octet-stream; name="bb.cxx"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="bb.cxx"


More information about the Gcc-bugs mailing list