================ @@ -62,6 +62,16 @@ AST_MATCHER(CXXMethodDecl, usesThis) { return false; // Stop traversal. } + bool VisitDeclRefExpr(const DeclRefExpr *E) { + if (const auto *PVD = dyn_cast_if_present<ParmVarDecl>(E->getDecl()); + PVD && PVD->isExplicitObjectParameter()) { + Used = true; + return false; // Stop traversal. + } + + return true; + } ---------------- flovent wrote:
You're right, traversing is not necessary, i ignore the fact that member functions can't be static as long as they have explicit `this` as parameter. https://github.com/llvm/llvm-project/pull/141391 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits