[clang] [clang] Document the type_visibility attribute (PR #79157)

Louis Dionne via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 8 08:27:54 PST 2024


================
@@ -5557,6 +5557,21 @@ See :doc:`LTOVisibility`.
   }];
 }
 
+def TypeVisibilityDocs : Documentation {
+  let Category = DocCatType;
+  let Content = [{
+The ``type_visibility`` attribute allows the ELF visibility of a type and its vague
+linkage objects (vtable, typeinfo, typeinfo name) to be controlled separately from
+the visibility of functions and data members of the type.
+
+For example, this can be used to give default visibility to the typeinfo and the vtable
+of a type while still keeping hidden visibility on its member functions and static data
+members.
+
+This attribute can only be applied to types and namespaces.
----------------
ldionne wrote:

This applies to classes too: https://godbolt.org/z/673qsnxsP

https://github.com/llvm/llvm-project/pull/79157


More information about the cfe-commits mailing list