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

via cfe-commits cfe-commits at lists.llvm.org
Thu May 1 03:45:30 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clangir

Author: Amr Hesham (AmrDeveloper)

<details>
<summary>Changes</summary>

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

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


1 Files Affected:

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


``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
index fa86fce2f6e5c..a424f7abd05c0 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.cpp
@@ -519,7 +519,7 @@ LValue CIRGenFunction::emitLValue(const Expr *e) {
     return emitBinaryOperatorLValue(cast<BinaryOperator>(e));
   case Expr::CompoundAssignOperatorClass: {
     QualType ty = e->getType();
-    if (const AtomicType *at = ty->getAs<AtomicType>()) {
+    if (ty->getAs<AtomicType>()) {
       cgm.errorNYI(e->getSourceRange(),
                    "CompoundAssignOperator with AtomicType");
       return LValue();

``````````

</details>


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


More information about the cfe-commits mailing list