diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -1226,6 +1226,11 @@ +
Matches fixed point literals +
Matches float literals of all sizes / encodings, e.g. 1.0, 1.0f, 1.0L and 1e10. @@ -5219,30 +5224,13 @@
Overloaded to match the declaration of the expression's or value -declaration's type. - -In case of a value declaration (for example a variable declaration), -this resolves one layer of indirection. For example, in the value -declaration "X x;", cxxRecordDecl(hasName("X")) matches the declaration of -X, while varDecl(hasType(cxxRecordDecl(hasName("X")))) matches the -declaration of x. - -Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X"))))) - and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X"))))) - and friend class X (matcher = friendDecl(hasType("X")) - class X {}; - void y(X &x) { x; X z; } - class Y { friend class X; }; ++ Matcher<CXXBaseSpecifier> hasClass Matcher<CXXRecordDecl> InnerMatcher @@ -5632,18 +5620,33 @@ Matches if the Base specifier refers to the given class matcher. Example matches class Derived -(matcher = cxxRecordDecl(hasAnyBase(hasType(cxxRecordDecl(hasName("Base")))))) +(matcher = cxxRecordDecl(hasAnyBase(hasClass(hasName("Base"))))) class Base {}; class Derived : Base {}; - -Usable as: Matcher<Expr>, Matcher<FriendDecl>, Matcher<ValueDecl>, -Matcher<CXXBaseSpecifier>Matcher<CXXRecordDecl> hasAnyBase Matcher<CXXBaseSpecifier> BaseSpecMatcher + Matches C++ classes that have a direct or indirect base matching BaseSpecMatcher. -Example matches DirectlyDerived, IndirectlyDerived (BaseSpecMatcher == -hasType(cxxRecordDecl(hasName("SpecialBase")))) class Foo; +Example: +matcher hasAnyBase(hasClass(hasName("SpecialBase"))) + class Foo; class Bar : Foo {}; class Baz : Bar {}; class SpecialBase; - class DirectlyDerived : SpecialBase {}; // directly derived - class IndirectlyDerived : DirectlyDerived {}; // indirectly derived + class Proxy : SpecialBase {}; // matches Proxy + class IndirectlyDerived : Proxy {}; //matches IndirectlyDerived FIXME: Refactor this and isDerivedFrom to reuse implementation.+ Matcher<CXXRecordDecl> hasDirectBase Matcher<CXXBaseSpecifier> BaseSpecMatcher + + Matches C++ classes that have a direct base matching BaseSpecMatcher. + +Example: +matcher hasDirectBase(hasClass(hasName("SpecialBase"))) + class Foo; + class Bar : Foo {}; + class Baz : Bar {}; + class SpecialBase; + class Proxy : SpecialBase {}; // matches Proxy + class IndirectlyDerived : Proxy {}; // doesn't match +Matcher<CXXRecordDecl> hasMethod Matcher<CXXMethodDecl> InnerMatcher @@ -6421,13 +6419,8 @@ void y(X &x) { x; X z; } class Y { friend class X; }; -Example matches class Derived -(matcher = cxxRecordDecl(hasAnyBase(hasType(cxxRecordDecl(hasName("Base")))))) -class Base {}; -class Derived : Base {}; -Usable as: Matcher<Expr>, Matcher<FriendDecl>, Matcher<ValueDecl>, -Matcher<CXXBaseSpecifier> +Usable as: Matcher<Expr>, Matcher<FriendDecl>, Matcher<ValueDecl> Matches the first method of a class or struct that satisfies InnerMatcher. @@ -6201,13 +6204,8 @@ void y(X &x) { x; X z; } class Y { friend class X; }; -Example matches class Derived -(matcher = cxxRecordDecl(hasAnyBase(hasType(cxxRecordDecl(hasName("Base")))))) -class Base {}; -class Derived : Base {}; -Usable as: Matcher<Expr>, Matcher<FriendDecl>, Matcher<ValueDecl>, -Matcher<CXXBaseSpecifier> +Usable as: Matcher<Expr>, Matcher<FriendDecl>, Matcher<ValueDecl>