Index: clang-move/ClangMove.cpp =================================================================== --- clang-move/ClangMove.cpp +++ clang-move/ClangMove.cpp @@ -24,6 +24,11 @@ namespace move { namespace { +// FIXME: Move to ASTMatchers. +AST_MATCHER(VarDecl, isStaticDataMember) { + return Node.isStaticDataMember(); +} + AST_MATCHER_P(Decl, hasOutermostEnclosingClass, ast_matchers::internal::Matcher, InnerMatcher) { const auto* Context = Node.getDeclContext(); @@ -365,7 +370,8 @@ this); // Match static member variable definition of the moved class. - Finder->addMatcher(varDecl(InMovedClass, InOldCC, isDefinition()) + Finder->addMatcher(varDecl(InMovedClass, InOldCC, isDefinition(), + isStaticDataMember()) .bind("class_static_var_decl"), this); Index: test/clang-move/Inputs/test.h =================================================================== --- test/clang-move/Inputs/test.h +++ test/clang-move/Inputs/test.h @@ -2,5 +2,6 @@ class Foo { public: int f(); + int f2(int a, int b); }; } // namespace a Index: test/clang-move/Inputs/test.cpp =================================================================== --- test/clang-move/Inputs/test.cpp +++ test/clang-move/Inputs/test.cpp @@ -5,4 +5,7 @@ int Foo::f() { return 0; } +int Foo::f2(int a, int b) { + return a + b; +} } // namespace a Index: test/clang-move/move-class.cpp =================================================================== --- test/clang-move/move-class.cpp +++ test/clang-move/move-class.cpp @@ -25,6 +25,7 @@ // CHECK-NEW-TEST-H: class Foo { // CHECK-NEW-TEST-H: public: // CHECK-NEW-TEST-H: int f(); +// CHECK-NEW-TEST-H: int f2(int a, int b); // CHECK-NEW-TEST-H: }; // CHECK-NEW-TEST-H: } // namespace a // @@ -32,6 +33,7 @@ // CHECK-NEW-TEST-CPP: #include "test2.h" // CHECK-NEW-TEST-CPP: namespace a { // CHECK-NEW-TEST-CPP: int Foo::f() { return 0; } +// CHECK-NEW-TEST-CPP: int Foo::f2(int a, int b) { return a + b; } // CHECK-NEW-TEST-CPP: } // namespace a // // CHECK-OLD-TEST-CPP: #include "test.h"