[PATCH] D56850: [ASTMatchers][NFC] Add tests for assorted `CXXMemberCallExpr` matchers.

Stephen Kelly via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 18 13:42:53 PST 2019


steveire added a comment.

Thanks, do you need someone to commit this for you?



================
Comment at: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:492
+  auto MatchesX = cxxMemberCallExpr(on(hasType(cxxRecordDecl(hasName("X")))));
+  EXPECT_TRUE(notMatches(Snippet1, MatchesX));
+  EXPECT_TRUE(matches(Snippet2, MatchesX));
----------------
In the `OnImplicitObjectArgument` test, you don't check snippet 1 because it has no `X`. This line is probably not needed.


================
Comment at: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:558
+          int m;
+          int f(X x) { return m; }
+        };
----------------
Are we missing a matcher that would reach the type of X in this case? `hasImplicitObjectExpression`, or something equivalent?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56850/new/

https://reviews.llvm.org/D56850





More information about the cfe-commits mailing list