[cfe-dev] Marking v-tables used whenever any virtual function is referenced

Rafael EspĂ­ndola rafael.espindola at gmail.com
Sun Jul 15 07:37:15 PDT 2012


> That one fails for me without the patch:

Yes, sorry, I was testing with an older version of clang.

> error: 'error' diagnostics seen but not expected:
>   Line 90: implicit instantiation of undefined member
> 'LazilyInstantiate::A<int>::Impl'
> error: 'note' diagnostics seen but not expected:
>   Line 96: in instantiation of member function
> 'LazilyInstantiate::scoped_ptr<LazilyInstantiate::A<int>::Impl>::~scoped_ptr'
> requested here
>   Line 107: in instantiation of member function
> 'LazilyInstantiate::A<int>::~A' requested here
>   Line 94: member is declared here
> 4 errors generated.
>
> We instantiate A<int>::F because it's used in C's vtable, which is used in
> C's constructor, and that leads to us instantiate A<int>'s vtable, which
> leads to us instantiate A<int>'s destructor, which fails. This test started
> failing as a result of r159895; prior to that, we weren't instantiating
> A<int>::F when building C's vtable. Is it possible you don't have that
> revision?
>

Correct.

The only potential problem I see with this patch is making it a bit
harder to fix pr13227, but we can worry about that when we get there.
Dgregor, any opinions on this?

Cheers,
Rafael



More information about the cfe-dev mailing list