https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120098
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jakub at gcc dot gnu.org
--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jan Hubicka from comment #11)
> I think what we need here is ability to search for vtables associated with a
> given anonymous namespace type and mark it as live when any of them are used
> (instead of taking just the default vtable). Is there a way to look them
> up? We will see them as a symbol, so we only need to be able to walk back to
> a given type.
On the build_vtable created decls (i.e. both _ZTV* vtables and _ZTT* VTTs)
DECL_CONTEXT is the class type for which the vtable/VTT has been created, and
by walking DECL_CONTEXT chain of that you'll eventually reach the anon
NAMESPACE_DECL (if it is in one).