https://github.com/bricknerb created https://github.com/llvm/llvm-project/pull/131165
None >From c7b3a1c83ca0bd2631e9dcfcce0fe672d1140cce Mon Sep 17 00:00:00 2001 From: Boaz Brickner <brick...@google.com> Date: Thu, 13 Mar 2025 17:01:26 +0100 Subject: [PATCH] [Clang] Improve `getReplacedTemplateParameterList()` const correctness --- clang/include/clang/AST/DeclTemplate.h | 2 +- clang/lib/AST/DeclTemplate.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/include/clang/AST/DeclTemplate.h b/clang/include/clang/AST/DeclTemplate.h index b82f75dd63fa5..b27e698236c02 100644 --- a/clang/include/clang/AST/DeclTemplate.h +++ b/clang/include/clang/AST/DeclTemplate.h @@ -3392,7 +3392,7 @@ inline std::optional<unsigned> getExpandedPackSize(const NamedDecl *Param) { /// Internal helper used by Subst* nodes to retrieve the parameter list /// for their AssociatedDecl. -TemplateParameterList *getReplacedTemplateParameterList(Decl *D); +TemplateParameterList *getReplacedTemplateParameterList(const Decl *D); } // namespace clang diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp index b8fe19c69dc29..c0f5be51db5f3 100644 --- a/clang/lib/AST/DeclTemplate.cpp +++ b/clang/lib/AST/DeclTemplate.cpp @@ -1642,7 +1642,7 @@ void TemplateParamObjectDecl::printAsInit(llvm::raw_ostream &OS, getValue().printPretty(OS, Policy, getType(), &getASTContext()); } -TemplateParameterList *clang::getReplacedTemplateParameterList(Decl *D) { +TemplateParameterList *clang::getReplacedTemplateParameterList(const Decl *D) { switch (D->getKind()) { case Decl::Kind::CXXRecord: return cast<CXXRecordDecl>(D) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits