GCC Bugzilla – Bug 8727
[3.2/3.3 regression] compiler confused by inheritance from an anonymous struct
Last modified: 2003-07-25 17:33:46 UTC
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. Release: 3.2.1 Environment: i686-pc-linux-gnu How-To-Repeat: gcc -c bb.cxx gives bb.cxx:10: redefinition of `const char _ZTS4Heya[6]' bb.cxx:10: `const char _ZTS4Heya[6]' previously defined here
Fix: http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00032.html
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed. It also fails on mainline.
Responsible-Changed-From-To: unassigned->mmitchel Responsible-Changed-Why: Working on a fix.
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed in G++ 3.2.2/G++ 3.3.
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/8727 Date: 1 Dec 2002 20:27:37 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2002-12-01 12:27:37 Modified files: gcc/cp : ChangeLog cp-tree.h init.c rtti.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/inherit: typedef1.C typeinfo1.C Log message: PR c++/8727 * g++.dg/inherit/typeinfo1.C: New test. PR c++/8663 * g++.dg/inherit/typedef1.C: New test. PR c++/8727 * cp-tree.h (lang_type_class): Add typeinfo_var. (CLASSTYPE_TYPEINFO_VAR): New macro. * rtti.c (get_tinfo_decl): Use it. PR c++/8663 * init.c (expand_member_init): Always get the main variant of a base class. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3061&r2=1.3062 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&r1=1.771&r2=1.772 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&r1=1.298&r2=1.299 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&r1=1.145&r2=1.146 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2243&r2=1.2244 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/typedef1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/typeinfo1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/8727 Date: 1 Dec 2002 20:40:38 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_2-branch Changes by: mmitchel@gcc.gnu.org 2002-12-01 12:40:38 Modified files: gcc/cp : ChangeLog cp-tree.h init.c rtti.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/inherit: typedef1.C typeinfo1.C Log message: PR c++/8727 * g++.dg/inherit/typeinfo1.C: New test. PR c++/8663 * g++.dg/inherit/typedef1.C: New test. PR c++/8727 * cp-tree.h (lang_type_class): Add typeinfo_var. (CLASSTYPE_TYPEINFO_VAR): New macro. * rtti.c (get_tinfo_decl): Use it. PR c++/8663 * init.c (expand_member_init): Always get the main variant of a base class. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.2685.2.114.2.46&r2=1.2685.2.114.2.47 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.681.2.12.2.9&r2=1.681.2.12.2.10 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.264.2.12.2.2&r2=1.264.2.12.2.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/rtti.c.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.130.6.2&r2=1.130.6.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=1.1672.2.166.2.61&r2=1.1672.2.166.2.62 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/typedef1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/inherit/typeinfo1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_2-branch&r1=NONE&r2=1.1.2.1