[clang] Add Clang attribute to ensure that fields are initialized explicitly (PR #102040)

via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 30 11:26:03 PDT 2024


================
@@ -1419,6 +1419,28 @@ is not specified.
   }];
 }
 
+def ExplicitInitDocs : Documentation {
+  let Category = DocCatField;
+  let Content = [{
+The ``clang::explicit_init`` attribute indicates that the field must be
+initialized explicitly by the caller when the class is constructed.
----------------
higher-performance wrote:

Updated, please take another look.

Per the RFC, we might want to forbid its usage on non-aggregates entirely, but I'm not sure exactly where/how to do that.

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


More information about the cfe-commits mailing list