[clang] [Sema] Remove an unnecessary cast (NFC) (PR #147546)

via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 8 08:13:58 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

D is already of CXXMethodDecl *.


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


1 Files Affected:

- (modified) clang/lib/Sema/SemaTemplateInstantiateDecl.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index a25bfd1c48dee..c6633cbe51cef 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -3029,7 +3029,7 @@ Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(
   LocalInstantiationScope Scope(SemaRef, MergeWithParentScope);
 
   Sema::LambdaScopeForCallOperatorInstantiationRAII LambdaScope(
-      SemaRef, const_cast<CXXMethodDecl *>(D), TemplateArgs, Scope);
+      SemaRef, D, TemplateArgs, Scope);
 
   // Instantiate enclosing template arguments for friends.
   SmallVector<TemplateParameterList *, 4> TempParamLists;

``````````

</details>


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


More information about the cfe-commits mailing list