================ @@ -727,6 +729,44 @@ void InitListChecker::FillInEmptyInitForField(unsigned Init, FieldDecl *Field, if (hadError || VerifyOnly) { // Do nothing } else if (Init < NumInits) { ---------------- Fznamznon wrote:
It seems `Init < NumInits` is always true for non-`VerifyOnly` mode only for structs. So, removing lines `684-685, 704-707, 772-778` breaks a number of tests with unions. The assertion on line 676 confirms: ``` if (Init >= NumInits || !ILE->getInit(Init)) { if (const RecordType *RType = ILE->getType()->getAs<RecordType>()) if (!RType->getDecl()->isUnion()) assert((Init < NumInits || VerifyOnly) && "This ILE should have been expanded"); ``` I can still put warning emission out of `Init < NumInits` check though if that seems more correct. https://github.com/llvm/llvm-project/pull/70829 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits