This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/35067] New: [4.2 Regression] multiple definition of virtual thunk


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]