[PATCH] D65092: [clang] Add isDirectlyDerivedFrom AST Matcher.

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 22 10:39:09 PDT 2019


klimek added inline comments.


================
Comment at: clang/include/clang/ASTMatchers/ASTMatchers.h:2637
               internal::Matcher<NamedDecl>, Base) {
-  return Finder->classIsDerivedFrom(&Node, Base, Builder);
+  return Finder->classIsDerivedFrom(&Node, Base, Builder, false);
 }
----------------
/*Directly=*/false
(and similarly below for true)


================
Comment at: clang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp:342
+  EXPECT_TRUE(notMatches("class Y;", IsDirectlyDerivedFromX));
+  EXPECT_TRUE(notMatches("", IsDirectlyDerivedFromX));
+
----------------
I think these tests are ~enough, given the implementation.
Specifically, I think duplicating all the negative tests is not covering more ground.
If you disagree, feel free to argue back :)



Repository:
  rC Clang

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

https://reviews.llvm.org/D65092





More information about the cfe-commits mailing list