@@ -62,16 +62,6 @@ AST_MATCHER(CXXMethodDecl, usesThis) {
6262 return false ; // Stop traversal.
6363 }
6464
65- bool VisitDeclRefExpr (const DeclRefExpr *E) {
66- if (const auto *PVD = dyn_cast_if_present<ParmVarDecl>(E->getDecl ());
67- PVD && PVD->isExplicitObjectParameter ()) {
68- Used = true ;
69- return false ; // Stop traversal.
70- }
71-
72- return true ;
73- }
74-
7565 // If we enter a class declaration, don't traverse into it as any usages of
7666 // `this` will correspond to the nested class.
7767 bool TraverseCXXRecordDecl (CXXRecordDecl *RD) { return true ; }
@@ -89,10 +79,10 @@ void ConvertMemberFunctionsToStatic::registerMatchers(MatchFinder *Finder) {
8979 cxxMethodDecl (
9080 isDefinition (), isUserProvided (),
9181 unless (anyOf (
92- isExpansionInSystemHeader (), isVirtual (), isStatic (),
93- hasTrivialBody (), isOverloadedOperator (), cxxConstructorDecl (),
94- cxxDestructorDecl (), cxxConversionDecl (), isTemplate (),
95- isDependentContext (),
82+ isExplicitObjectMemberFunction (), isExpansionInSystemHeader (),
83+ isVirtual (), isStatic (), hasTrivialBody (), isOverloadedOperator (),
84+ cxxConstructorDecl (), cxxDestructorDecl (), cxxConversionDecl (),
85+ isTemplate (), isDependentContext (),
9686 ofClass (anyOf (
9787 isLambda (),
9888 hasAnyDependentBases ()) // Method might become virtual
0 commit comments