[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:06:29 PDT 2025
https://github.com/AmrDeveloper created https://github.com/llvm/llvm-project/pull/138415
This fixes a warning where a variable assigned in 'if' statement wasn't referenced again.
>From 6acc708aabc3f53d2899b322d4d96194bfc9440d 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