From 8c4220059838cdbee909494b80a37e1f92330a3d Mon Sep 17 00:00:00 2001 From: Anton Bikineev Date: Thu, 25 Jul 2019 11:54:13 +0000 Subject: [clang] Add isDirectlyDerivedFrom AST matcher. Differential Revision: https://reviews.llvm.org/D65092 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@367010 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LibASTMatchersReference.html | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'docs') diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index c93394096f..9f13331aa1 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -2581,6 +2581,11 @@ class y; +Matcher<CXXRecordDecl>isDirectlyDerivedFromstd::string BaseName +
Overloaded method as shortcut for isDirectlyDerivedFrom(hasName(...)).
+
+ + Matcher<CXXRecordDecl>isExplicitTemplateSpecialization
Matches explicit template specializations of function, class, or
 static member variable template instantiations.
@@ -5263,6 +5268,26 @@ In the following example, Bar matches isDerivedFrom(hasName("X")):
 
+Matcher<CXXRecordDecl>isDirectlyDerivedFromMatcher<NamedDecl> Base +
Matches C++ classes that are directly derived from a class matching Base.
+
+Note that a class is not considered to be derived from itself.
+
+Example matches Y, C (Base == hasName("X"))
+  class X;
+  class Y : public X {};  // directly derived
+  class Z : public Y {};  // indirectly derived
+  typedef X A;
+  typedef A B;
+  class C : public B {};  // derived from a typedef of X
+
+In the following example, Bar matches isDerivedFrom(hasName("X")):
+  class Foo;
+  typedef Foo X;
+  class Bar : public Foo {};  // derived from a type that X is a typedef of
+
+ + Matcher<CXXRecordDecl>isSameOrDerivedFromMatcher<NamedDecl> Base
Similar to isDerivedFrom(), but also matches classes that directly
 match Base.
-- 
cgit v1.2.1