https://github.com/Thibault-Monnier created 
https://github.com/llvm/llvm-project/pull/174246

This fixes the clang warning when compiling with CIR enabled:
```cpp
llvm-project/clang/lib/CIR/CodeGen/CIRGenTypes.cpp:713:19: warning: variable 
'ed' set but not used [-Wunused-but-set-variable]
  713 |   if (const auto *ed = dyn_cast<EnumDecl>(td)) {
      |                   ^
```

>From 3d2450831d2d5dff06abee64bd550cf31c1bad38 Mon Sep 17 00:00:00 2001
From: Thibault-Monnier <[email protected]>
Date: Fri, 2 Jan 2026 23:06:14 +0100
Subject: [PATCH] Fix unused variable warning

---
 clang/lib/CIR/CodeGen/CIRGenTypes.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/CIR/CodeGen/CIRGenTypes.cpp 
b/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
index 5264357448271..1321246d5179a 100644
--- a/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenTypes.cpp
@@ -710,7 +710,7 @@ void CIRGenTypes::updateCompletedType(const TagDecl *td) {
   // If this is an enum being completed, then we flush all non-struct types
   // from the cache. This allows function types and other things that may be
   // derived from the enum to be recomputed.
-  if (const auto *ed = dyn_cast<EnumDecl>(td)) {
+  if (isa<EnumDecl>(td)) {
     // Classic codegen clears the type cache if it contains an entry for this
     // enum type that doesn't use i32 as the underlying type, but I can't find
     // a test case that meets that condition. C++ doesn't allow forward

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to