[clang] [CIR][NFC] Fix build problem inside an assert (PR #169715)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 26 11:33:52 PST 2025


https://github.com/andykaylor created https://github.com/llvm/llvm-project/pull/169715

A recent change introduced a failure in debug builds due to an incorrect level of indirection inside an assert. This fixes that.

>From d4ab624e7e38a0346b18e4efc910fd388790663a Mon Sep 17 00:00:00 2001
From: Andy Kaylor <akaylor at nvidia.com>
Date: Wed, 26 Nov 2025 11:31:14 -0800
Subject: [PATCH] [CIR][NFC] Fix build problem inside an assert

A recent change introduced a failure in debug builds due to an incorrect
level of indirection inside an assert. This fixes that.
---
 clang/lib/CIR/CodeGen/CIRGenFunction.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
index 5150a1682f712..22128ed3521f8 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
@@ -1142,7 +1142,7 @@ CIRGenFunction::VlaSizePair
 CIRGenFunction::getVLAElements1D(const VariableArrayType *vla) {
   mlir::Value vlaSize = vlaSizeMap[vla->getSizeExpr()];
   assert(vlaSize && "no size for VLA!");
-  assert(vlaSize->getType() == sizeTy);
+  assert(vlaSize.getType() == sizeTy);
   return {vlaSize, vla->getElementType()};
 }
 



More information about the cfe-commits mailing list