[clang] [clang] Fix Variable Length Array `_Countof` Crash (PR #154627)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 21 04:18:47 PDT 2025
================
@@ -15345,6 +15345,13 @@ bool IntExprEvaluator::VisitUnaryExprOrTypeTraitExpr(
const auto *VAT = Info.Ctx.getAsVariableArrayType(Ty);
assert(VAT);
if (VAT->getElementType()->isArrayType()) {
+ // Variable array size expression could be missing (e.g. int a[*][10]) In
+ // that case, it can't be a constant expression
----------------
AaronBallman wrote:
```suggestion
// that case, it can't be a constant expression.
```
https://github.com/llvm/llvm-project/pull/154627
More information about the cfe-commits
mailing list