[cfe-dev] Bug 6251 questions

Anders Carlsson andersca at mac.com
Wed Mar 10 08:04:54 PST 2010


10 mar 2010 kl. 05.38 skrev Gonsolo:

> Hi!
> 
> The following program
> 
> class A {
>         public:
>                 char c;
>                 virtual ~A() {}
> };
> class B : virtual public A {};
> class C : virtual public A {};
> class D : public B, public C {};
> 
> int main()
> {
> 	        D d;
> }
> 
> 
> fails with
> 
> bla.o:(.rodata+0x54): undefined reference to `virtual thunk to C::~C()'
> collect2: ld returned 1 exit status
> 
> 
> I have some questions:
> 
> 1. Is this problem known?

Yes, this is a bug in the old vtable layout code. It's been fixed in the new code that hasn't been turned on yet (I'm still fixing the last few bugs here).

> 2. How do I dump a vtable, since "clang++ -emit-llvm-only 
> -fdump-vtable-layouts" doesn't work for me?

You need to use clang -cc1 to dump the layout. Keep in mind that dumping the layout uses the new layout code where this bug has already been fixed.

> 3. I would like to fix this, but I have no idea how. How to proceed?
> 

No need, it's been fixed in the new code which I hope to turn on soon!

Thanks,
Anders




More information about the cfe-dev mailing list