public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35067]  New: [4.2 Regression] multiple definition of virtual thunk
@ 2008-02-03 22:32 vincent dot riviere at freesbee dot fr
  2008-02-03 22:36 ` [Bug c++/35067] " pinskia at gcc dot gnu dot org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: vincent dot riviere at freesbee dot fr @ 2008-02-03 22:32 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2009-11-04 23:41 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-03 22:32 [Bug c++/35067] New: [4.2 Regression] multiple definition of virtual thunk vincent dot riviere at freesbee dot fr
2008-02-03 22:36 ` [Bug c++/35067] " pinskia at gcc dot gnu dot org
2008-02-03 22:57 ` vincent dot riviere at freesbee dot fr
2008-02-03 23:03 ` vincent dot riviere at freesbee dot fr
2008-02-03 23:04 ` vincent dot riviere at freesbee dot fr
2008-02-04 10:14 ` rguenth at gcc dot gnu dot org
2008-02-04 13:34 ` vincent dot riviere at freesbee dot fr
2008-02-04 13:36 ` [Bug c++/35067] [4.2/4.3 " rguenth at gcc dot gnu dot org
2008-02-04 13:39 ` vincent dot riviere at freesbee dot fr
2008-02-04 14:03 ` vincent dot riviere at freesbee dot fr
2008-02-05 20:31 ` jakub at gcc dot gnu dot org
2008-05-19 20:33 ` [Bug c++/35067] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2009-03-31 20:18 ` [Bug c++/35067] [4.3/4.4/4.5 " jsm28 at gcc dot gnu dot org
2009-08-04 12:38 ` rguenth at gcc dot gnu dot org
2009-11-03 21:21 ` jason at gcc dot gnu dot org
2009-11-04 19:56 ` jason at gcc dot gnu dot org
2009-11-04 20:09 ` jason at gcc dot gnu dot org
2009-11-04 20:10 ` jason at gcc dot gnu dot org
2009-11-04 23:41 ` vincent dot riviere at freesbee dot fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).