[clang-move] Matching static class member more correctly.

Reviewers: ioeric

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D25598

llvm-svn: 284221
diff --git a/clang-tools-extra/clang-move/ClangMove.cpp b/clang-tools-extra/clang-move/ClangMove.cpp
index a741f55..af1711c 100644
--- a/clang-tools-extra/clang-move/ClangMove.cpp
+++ b/clang-tools-extra/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<Decl>, 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);