It is used in libc++ on many template types such as tuple_element
, tuple
, etc.
As far as I can tell there is no public documentation of what it does other than the commit message introducing it and this unit test in the clang project.
This attribute allows the ELF visibility of a type and (presumably) its vague linkage objects (vtable, typeinfos) to be controlled separately from the visibility of functions and data members of the type.
This allows typeinfos and the vtable for, say, explicit instantiations of a templated polymorphic type to be located centrally without forcing default visibility on for the type's private static data members as well -- exporting symbols for things that nobody will ever actually access across a library boundary is wasteful of runtime and symbol table space when working with shared libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With