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

via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 12 10:10:35 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/143933.diff


1 Files Affected:

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


``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenCall.cpp b/clang/lib/CIR/CodeGen/CIRGenCall.cpp
index da754e0806b2d..67c6a8dd3ef5a 100644
--- a/clang/lib/CIR/CodeGen/CIRGenCall.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenCall.cpp
@@ -171,7 +171,7 @@ void CIRGenFunction::emitDelegateCallArg(CallArgList &args,
 
   QualType type = param->getType();
 
-  if (const auto *rd = type->getAsCXXRecordDecl()) {
+  if (type->getAsCXXRecordDecl()) {
     cgm.errorNYI(param->getSourceRange(),
                  "emitDelegateCallArg: record argument");
     return;

``````````

</details>


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


More information about the cfe-commits mailing list