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

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 9 09:37:46 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Andy Kaylor (andykaylor)

<details>
<summary>Changes</summary>

This fixes a warning where a variable assigned in a 'if' statement wasn't referenced again.

---
Full diff: https://github.com/llvm/llvm-project/pull/135046.diff


1 Files Affected:

- (modified) clang/lib/CIR/CodeGen/CIRGenExpr.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
index fe3f2f5de249c..0a7b3a837ed39 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExpr.cpp
@@ -35,7 +35,7 @@ Address CIRGenFunction::emitPointerWithAlignment(const Expr *expr) {
 
   // Casts:
   if (auto const *ce = dyn_cast<CastExpr>(expr)) {
-    if (auto const *ece = dyn_cast<ExplicitCastExpr>(ce)) {
+    if (isa<ExplicitCastExpr>(ce)) {
       cgm.errorNYI(expr->getSourceRange(),
                    "emitPointerWithAlignment: explicit cast");
       return Address::invalid();

``````````

</details>


https://github.com/llvm/llvm-project/pull/135046


More information about the cfe-commits mailing list