================
@@ -727,6 +729,44 @@ void InitListChecker::FillInEmptyInitForField(unsigned 
Init, FieldDecl *Field,
     if (hadError || VerifyOnly) {
       // Do nothing
     } else if (Init < NumInits) {
----------------
Fznamznon wrote:

> Maybe consider changing the L674 condition to an assert(Init < NumInits) and 
> simplify this too?

I'm not sure I understand the suggestion. The condition on L674 looks like:
```
if (Init >= NumInits || !ILE->getInit(Init)) {
```
Even if I only remove `Init >= NumInits`, build of check-clang starts asserting 
with
```
Assertion `Init < getNumInits() && "Initializer access out of range!"'
```

Removing `!ILE->getInit(Init)` also doesn't seem logical to me since 
`FillInEmptyInitForField` is called for all fields in a record.

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

Reply via email to