[PATCH] D152083: [clang] Warning for uninitialized elements in fixed-size arrays
Nikolas Klauser via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 6 08:52:29 PDT 2023
philnik added inline comments.
================
Comment at: clang/include/clang/Basic/DiagnosticGroups.td:732
def UninitializedConstReference : DiagGroup<"uninitialized-const-reference">;
+def UninitializedArrayElements : DiagGroup<"uninitialized-array-elements">;
def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes,
----------------
Why do you make this a new warning group instead of just adding it to `-Wuninitialized`?
================
Comment at: clang/lib/Sema/SemaInit.cpp:983
RequiresSecondPass, nullptr, 0);
+
+ if (const ConstantArrayType *CAType = dyn_cast<ConstantArrayType>(T)) {
----------------
You'll want to add tests for this in `clang/test/Sema`
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152083/new/
https://reviews.llvm.org/D152083
More information about the cfe-commits
mailing list