================
@@ -21030,6 +20968,15 @@ ExprResult Sema::ActOnConstantExpression(ExprResult 
Res) {
   return CheckLValueToRValueConversionOperand(Res.get());
 }
 
+ExprResult Sema::ActOnArrayBound(ExprResult Bound) {
+  // Wrap now, before the bound's context drops the cleanups, with the lvalue
+  // conversion inside the wrapper. A class-typed bound is converted later by
+  // BuildArrayType and is left alone.
+  if (!Bound.isUsable() || Bound.get()->getType()->isRecordType())
----------------
akash-manna-sky wrote:

Can't do it in `BuildArrayType`: by then the bound's constant-evaluated context 
is popped and the cleanups are gone (that's also why the `ActOnFinishFullExpr` 
in the CCE path never wrapped anything). So `ActOnArrayBound` now wraps every 
bound, no type check, and `checkArraySize`'s CCE branch just converts what's 
inside the wrapper. @efriedma-quic 


https://github.com/llvm/llvm-project/pull/244274
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to