This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/35067] New: [4.2 Regression] multiple definition of virtual thunk
- From: "vincent dot riviere at freesbee dot fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 Feb 2008 22:32:09 -0000
- Subject: [Bug c++/35067] New: [4.2 Regression] multiple definition of virtual thunk
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
C++ programs using virtual inheritance cannot be linked due to multiple
definitions of thunk symbols.
$ cat c.h
class B
{
public:
virtual ~B() { }
};
class C : virtual public B
{
};
$ cat f1.cpp
#include "c.h"
C c1;
main() { }
$ cat f2.cpp
#include "c.h"
C c2;
$ g++ f1.cpp f2.cpp -nostartfiles
/tmp/ccU01avI.o:/tmp/ccU01avI.o:(.text+0x6c): multiple definition of `virtual
thunk to C::~C()'
/tmp/ccwZV0B9.o:/tmp/ccwZV0B9.o:(.text+0x90): first defined here
/tmp/ccU01avI.o:/tmp/ccU01avI.o:(.text+0x122): multiple definition of `virtual
thunk to C::~C()'
/tmp/ccwZV0B9.o:/tmp/ccwZV0B9.o:(.text+0x146): first defined here
Note: I use -nostartfiles because crt0.o is not available in my test
environment.
This is a regression.
The same testcase has no problem with GCC 4.1.2
--
Summary: [4.2 Regression] multiple definition of virtual thunk
Product: gcc
Version: 4.2.3
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: vincent dot riviere at freesbee dot fr
GCC target triplet: i386-netbsd
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35067