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

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 23 09:00:20 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.
----------------
philnik777 wrote:

Maybe we also want to document the behavior of adding both `clang::type_visibility` and `gnu::visibility` to a namespace? (I think `clang::type_visibility` overrides `gnu::visibility`)

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


More information about the cfe-commits mailing list