[clang] Fix the warning in RefCntblBaseVirtualDtorChecker.cpp:61 (PR #93403)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 26 00:37:51 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-static-analyzer-1

Author: Ryosuke Niwa (rniwa)

<details>
<summary>Changes</summary>



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


1 Files Affected:

- (modified) clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp
index 26879f2f87c8b..9df108e28ecdb 100644
--- a/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/WebKit/RefCntblBaseVirtualDtorChecker.cpp
@@ -58,7 +58,7 @@ class DerefFuncDeleteExprVisitor
   std::optional<bool> HasSpecializedDelete(CXXMethodDecl *Decl) {
     if (auto *Body = Decl->getBody())
       return VisitBody(Body);
-    if (auto *Tmpl = Decl->getTemplateInstantiationPattern())
+    if (Decl->getTemplateInstantiationPattern())
       return std::nullopt; // Indeterminate. There was no concrete instance.
     return false;
   }

``````````

</details>


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


More information about the cfe-commits mailing list