================ @@ -4030,9 +4030,13 @@ findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, if (ObjType->isArrayType()) { // Next subobject is an array element. const ConstantArrayType *CAT = Info.Ctx.getAsConstantArrayType(ObjType); - assert(CAT && "vla in literal type?"); + const IncompleteArrayType *IAT = + Info.Ctx.getAsIncompleteArrayType(ObjType); + const ArrayType *AT = CAT ? static_cast<const ArrayType *>(CAT) + : static_cast<const ArrayType *>(IAT); + assert(AT && "vla in literal type?"); ---------------- cor3ntin wrote:
I think using getAsArrayType() and asserting the type is either `ConstantArrayType` or `IncompleteArrayType` would simplify that code a bit https://github.com/llvm/llvm-project/pull/155080 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits