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

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


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

D is already of CXXMethodDecl *.


>From fac2b8100d07fa36191caf3643218ff95adc5e9a Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Tue, 8 Jul 2025 07:18:59 -0700
Subject: [PATCH] [Sema] Remove an unnecessary cast (NFC)

D is already of CXXMethodDecl *.
---
 clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;



More information about the cfe-commits mailing list