[clang] [CIR][NFC] Fix an unused variable warning (PR #138415)

Amr Hesham via cfe-commits cfe-commits at lists.llvm.org
Sat May 3 10:07:06 PDT 2025


https://github.com/AmrDeveloper updated https://github.com/llvm/llvm-project/pull/138415

>From 1b43e41c4ad14215977e9f2f0a4f1c2ed3895be1 Mon Sep 17 00:00:00 2001
From: AmrDeveloper <amr96 at programmer.net>
Date: Sat, 3 May 2025 19:05:36 +0200
Subject: [PATCH] [CIR][NFC] Fix an unused variable warning

---
 clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
index ab1ea07bbf5ef..2d8550fad454c 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
@@ -90,9 +90,10 @@ class ConstExprEmitter
   }
 
   mlir::Attribute VisitCastExpr(CastExpr *e, QualType destType) {
-    if (const auto *ece = dyn_cast<ExplicitCastExpr>(e))
+    if (isa<ExplicitCastExpr>(e))
       cgm.errorNYI(e->getBeginLoc(),
                    "ConstExprEmitter::VisitCastExpr explicit cast");
+
     Expr *subExpr = e->getSubExpr();
 
     switch (e->getCastKind()) {



More information about the cfe-commits mailing list