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

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 4 11:20:02 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:

I just pushed an update to emit `warn_cxx20_compat_aggregate_init_with_ctors` when the aggregate would be incompatible with C++20.

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


More information about the cfe-commits mailing list