This is about the problem described in https://discourse.llvm.org/t/apvalue-lifetime-problem-when-evaluating-constant-expressions/64002/5
The (old) condition in this if statement is meant to handle initializers that depend on (other) array elements. In this case, the array needs to be expanded before the array filler is evaluated:
if (NumEltsToInit != NumElts && MaybeElementDependentArrayFiller(FillerExpr)) NumEltsToInit = NumElts;
in the test case described on Discourse (which is attached in the patch), MaybeElementDependentArrayFiller() returns false for the outer array but true for the inner array. Since every InitListExpr can have an array filler, I believe the function should take that into account.
This fixes https://github.com/llvm/llvm-project/issues/56016
Nit: It might be helpful to add a comment to this test explaining what it's testing. This makes it easier to diagnose tests failures (e.g. in downstream forks) without having to rely on git blame.