Bug 6251 questions

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Bug 6251 questions

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?
2. How do I dump a vtable, since "clang++ -emit-llvm-only
-fdump-vtable-layouts" doesn't work for me?
3. I would like to fix this, but I have no idea how. How to proceed?

Thanks,

g
_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Bug 6251 questions

Anders Carlsson

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

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Bug 6251 questions

Gonsolo
In reply to this post by Gonsolo
Anders,

it occurred to me that you switched on the new vtable code. The
following code still fails to link with:

bla.o:(.rodata+0x54): undefined reference to `virtual thunk to C::~C()'

Are you aware of this?

> 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;
> }

Thanks,

g

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev