[PATCH] D94864: [ASTMatchers] Re-order the internals to allow another use-case

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 06:05:53 PST 2021


aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM, though it would have been a bit easier to review had the rearranging been done in a separate NFC patch.



================
Comment at: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:498-500
+  EXPECT_TRUE(
+      matches(Code, cxxBoolLiteral(equals(false),
+                                   hasAncestor(mapAnyOf(ifStmt, forStmt)))));
----------------
Can you also add a test like:
```
EXPECT_TRUE(notMatches(Code, floatLiteral(hasAncestor(mapAnyOf(ifStmt, forStmt)))));
```
to show that we can still search all of the nodes and fail.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94864



More information about the cfe-commits mailing list