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

via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 3 19:28:32 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

Decl is already of FunctionDecl *.


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


1 Files Affected:

- (modified) clang/lib/Sema/SemaConcept.cpp (+2-2) 


``````````diff
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 1594b4423e4d2..be9737d9e7c1a 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -1138,8 +1138,8 @@ bool Sema::CheckFunctionTemplateConstraints(
   }
 
   CXXThisScopeRAII ThisScope(*this, Record, ThisQuals, Record != nullptr);
-  LambdaScopeForCallOperatorInstantiationRAII LambdaScope(
-      *this, const_cast<FunctionDecl *>(Decl), *MLTAL, Scope);
+  LambdaScopeForCallOperatorInstantiationRAII LambdaScope(*this, Decl, *MLTAL,
+                                                          Scope);
 
   return CheckConstraintSatisfaction(Template, TemplateAC, *MLTAL,
                                      PointOfInstantiation, Satisfaction);

``````````

</details>


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


More information about the cfe-commits mailing list