[clang-tools-extra] [clang-tidy] Fix convert-member-functions-to-static crash on attributed methods (PR #223007)

Zeyi Xu via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 11 21:28:03 PDT 2026


================
@@ -148,7 +148,7 @@ static SourceRange getLocationOfConst(const TypeSourceInfo *TSI,
                                       const SourceManager &SourceMgr,
                                       const LangOptions &LangOpts) {
   assert(TSI);
-  const auto FTL = TSI->getTypeLoc().IgnoreParens().getAs<FunctionTypeLoc>();
+  const auto FTL = TSI->getTypeLoc().getAsAdjusted<FunctionTypeLoc>();
----------------
zeyi2 wrote:

Yes. Please see comments in https://github.com/llvm/llvm-project/blob/82acc62cf1f1e0be3addcfa8f9538027176b2232/clang/include/clang/AST/TypeLoc.h#L98-L103

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


More information about the cfe-commits mailing list