[clang] [llvm] [clang-tools-extra] [clang] Fix false positive -Wmissing-field-initializer for anonymous unions (PR #70829)
Mariya Podchishchaeva via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 14 02:42:54 PST 2023
================
@@ -654,11 +655,17 @@ void InitListChecker::FillInEmptyInitForBase(
}
}
-void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field,
- const InitializedEntity &ParentEntity,
- InitListExpr *ILE,
- bool &RequiresSecondPass,
- bool FillWithNoInit) {
+static bool hasAnyDesignatedInits(const InitListExpr *IL) {
+ for (const Stmt *Init : *IL)
+ if (isa_and_nonnull<DesignatedInitExpr>(Init))
+ return true;
+ return false;
----------------
Fznamznon wrote:
Ok, done.
https://github.com/llvm/llvm-project/pull/70829
More information about the llvm-commits
mailing list