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

via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 25 10:31:55 PDT 2024


================
@@ -81,6 +82,7 @@ CXXRecordDecl::DefinitionData::DefinitionData(CXXRecordDecl *D)
       HasPrivateFields(false), HasProtectedFields(false),
       HasPublicFields(false), HasMutableFields(false), HasVariantMembers(false),
       HasOnlyCMembers(true), HasInitMethod(false), HasInClassInitializer(false),
+      HasUninitializedExplicitInitFields(false),
----------------
higher-performance wrote:

I moved it to `RecordDecl`, though I'm not sure if using one of the `ODRHash` bits there (to prevent overflowing 8 bytest to 16) might cause any issues. Please take another look.

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


More information about the cfe-commits mailing list