================
@@ -2055,8 +2055,14 @@ static ExprResult checkArraySize(Sema &S, Expr
*&ArraySize,
// allow non-constant expressions and constant-folding. We only need to use
// the converted constant expression rules (to properly convert the source)
// when the source expression is of class type.
- return S.CheckConvertedConstantExpression(
- ArraySize, S.Context.getSizeType(), SizeVal, CCEKind::ArrayBound);
+ //
+ // Convert the bound itself, inside the ExprWithCleanups ActOnArrayBound
+ // may have wrapped it in.
+ Expr *Bound = ArraySize;
+ if (auto *Cleanups = dyn_cast<ExprWithCleanups>(Bound))
----------------
akash-manna-sky wrote:
No, it can't find them again, that list was consumed when `ActOnArrayBound`
built the wrapper. `BuildArrayType` keeps the wrapped `ArraySize` as the size
expression anyway and only takes the value from the CCE result, but relying on
that is fragile, so the branch now puts the same wrapper (same objects) back
around what CCE returns.
https://github.com/llvm/llvm-project/pull/244274
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits