[PATCH] D69218: [ASTMatchers] Add `cxxBaseSpecifier` matcher (non-top-level)

Nikita Kniazev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 21 06:39:04 PDT 2021


nick added inline comments.


================
Comment at: clang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp:329
+  EXPECT_TRUE(matches("class X {}; class Y : X {};", ClassHasBaseClassX));
+  EXPECT_TRUE(notMatches("class Z {}; class Y : Z {};", ClassHasBaseClassX));
+}
----------------
aaron.ballman wrote:
> I'd like to see another test along these lines:
> ```
> struct Base {};
> struct Intermediate : Base {};
> struct Derived : Intermediate {};
> ```
> Where we test that `Derived` does not have a direct base relationship with `Base`, but does with `hasAnyBase`.
I do not understand why it should be here. The point of this test is to ensure that `hasType` can be used inside `cxxBaseSpecifier`.  The support was added in D79063 without a test and I just fill the gaps. 



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

https://reviews.llvm.org/D69218



More information about the cfe-commits mailing list