Index: docs/LibASTMatchersReference.html =================================================================== --- docs/LibASTMatchersReference.html +++ docs/LibASTMatchersReference.html @@ -111,7 +111,7 @@ -
Matches C++ access specifier declarations. Given @@ -124,7 +124,7 @@
Matches C++ class template declarations. Example matches Z @@ -132,7 +132,7 @@
Matches C++ class template specializations. Given @@ -144,7 +144,7 @@
Matches C++ constructor declarations. Example matches Foo::Foo() and Foo::Foo(int) @@ -157,7 +157,7 @@
Matches conversion operator declarations. Example matches the operator. @@ -165,7 +165,7 @@
Matches explicit C++ destructor declarations. Example matches Foo::~Foo() @@ -176,7 +176,7 @@
Matches method declarations. Example matches y @@ -184,7 +184,7 @@
Matches C++ class declarations. Example matches X, Z @@ -193,7 +193,7 @@
Matches declarations. Examples matches X, C, and the friend declaration inside C; @@ -204,7 +204,7 @@
Matches declarator declarations (field, variable, function and non-type template parameter declarations). @@ -215,7 +215,7 @@
Matches enum constants. Example matches A, B, C @@ -225,7 +225,7 @@
Matches enum declarations. Example matches X @@ -235,7 +235,7 @@
Matches field declarations. Given @@ -245,7 +245,7 @@
Matches friend declarations. Given @@ -255,7 +255,7 @@
Matches function declarations. Example matches f @@ -263,7 +263,7 @@
Matches C++ function template declarations. Example matches f @@ -271,7 +271,7 @@
Matches a declaration of label. Given @@ -282,7 +282,7 @@
Matches a declaration of a linkage specification. Given @@ -292,7 +292,7 @@
Matches a declaration of anything that could have a name. Example matches X, S, the anonymous union type, i, and U; @@ -305,7 +305,7 @@
Matches a declaration of a namespace alias. Given @@ -316,7 +316,7 @@
Matches a declaration of a namespace. Given @@ -327,7 +327,7 @@
Matches non-type template parameter declarations. Given @@ -337,7 +337,7 @@
Matches Objective-C interface declarations. Example matches Foo @@ -346,7 +346,7 @@
Matches parameter variable declarations. Given @@ -356,7 +356,7 @@
Matches class, struct, and union declarations. Example matches X, Z, U, and S @@ -367,7 +367,7 @@
Matches a C++ static_assert declaration. Example: @@ -382,7 +382,7 @@
Matches template type parameter declarations. Given @@ -392,7 +392,7 @@
Matches the top declaration context. Given @@ -405,7 +405,7 @@
Matches type alias declarations. Given @@ -416,7 +416,7 @@
Matches typedef declarations. Given @@ -427,7 +427,7 @@
Matches typedef name declarations. Given @@ -438,7 +438,7 @@
Matches unresolved using value declarations that involve the typename. @@ -454,7 +454,7 @@ matches using Base<T>::Foo
Matches unresolved using value declarations. Given @@ -466,7 +466,7 @@ matches using X::x
Matches using declarations. Given @@ -476,7 +476,7 @@ matches using X::x
Matches using namespace declarations. Given @@ -486,7 +486,7 @@ matches using namespace X
Matches any value declaration. Example matches A, B, C and F @@ -495,7 +495,7 @@
Matches variable declarations. Note: this does not match declarations of member variables, which are @@ -1654,7 +1654,7 @@
Matches template specialization types. Given @@ -2284,7 +2284,7 @@
Matches if a node equals a previously bound node. Matches a node if it equals the node previously bound to ID. @@ -2307,14 +2307,14 @@
Matches if a node equals another node. Decl has pointer identity in the AST.
Matches declaration that has a given attribute. Given @@ -2325,7 +2325,7 @@
Matches AST nodes that were expanded within files whose name is partially matching a given regex. @@ -2336,11 +2336,11 @@ ASTMatcher.h: class Y {}; -Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc> +Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>
Matches AST nodes that were expanded within the main-file. Example matches X but not Y @@ -2350,11 +2350,11 @@ Y.h: class Y {}; -Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc> +Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>
Matches AST nodes that were expanded within system-header-files. Example matches Y but not X @@ -2364,17 +2364,17 @@ SystemHeader.h: class Y {}; -Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc> +Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>
Matches a declaration that has been implicitly added by the compiler (eg. implicit defaultcopy constructors).
Matches private C++ declarations. Given @@ -2388,7 +2388,7 @@
Matches protected C++ declarations. Given @@ -2402,7 +2402,7 @@
Matches public C++ declarations. Given @@ -3128,7 +3128,7 @@ ASTMatcher.h: class Y {}; -Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc> +Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>
Matches if the number of template arguments equals N. Given @@ -3243,7 +3243,7 @@ ASTMatcher.h: class Y {}; -Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc> +Usable as: Matcher<Decl>, Matcher<Stmt>, Matcher<TypeLoc>
Matches declarations that are template instantiations or are inside template instantiations. @@ -3759,7 +3759,7 @@
Matches a node if the declaration associated with that node matches the given matcher. @@ -3777,7 +3777,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches a node if the declaration associated with that node matches the given matcher. @@ -4009,7 +4009,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Overloaded to match the type's declaration. -
Matches if the expression's type either matches the specified matcher, or is a pointer to a type that matches the InnerMatcher.
Overloaded to match the type's declaration. +
Matches each method overriden by the given method. This matcher may produce multiple matches. @@ -4175,7 +4175,7 @@
Matches a node if the declaration associated with that node matches the given matcher. @@ -4193,7 +4193,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches if the call expression's callee's declaration matches the -given matcher. - -Example matches y.x() (matcher = callExpr(callee( - cxxMethodDecl(hasName("x"))))) - class Y { public: void x(); }; - void z() { Y y; y.x(); } -
Matches if the call expression's callee expression matches. @@ -4262,11 +4251,22 @@ Note: Callee cannot take the more general internal::Matcher<Expr> because this introduces ambiguous overloads with calls to Callee taking a -internal::Matcher<Decl>, as the matcher hierarchy is purely +internal::Matcher<Decl>, as the matcher hierarchy is purely implemented in terms of implicit casts.
Matches if the call expression's callee's declaration matches the +given matcher. + +Example matches y.x() (matcher = callExpr(callee( + cxxMethodDecl(hasName("x"))))) + class Y { public: void x(); }; + void z() { Y y; y.x(); } +
Matches all arguments and their respective ParmVarDecl. @@ -4310,7 +4310,7 @@
Matches a node if the declaration associated with that node matches the given matcher. @@ -4328,7 +4328,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches a node if the declaration associated with that node matches the given matcher. @@ -4457,7 +4457,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches a DeclRefExpr that refers to a declaration that matches the specified matcher. @@ -4490,7 +4490,7 @@
Matches the n'th declaration of a declaration statement. Note that this does not work for global declarations because the AST @@ -4509,7 +4509,7 @@
Matches the Decl of a DeclStmt which has a single declaration. Given @@ -4531,7 +4531,7 @@
Matches declarations whose declaration context, interpreted as a Decl, matches InnerMatcher. @@ -4603,7 +4603,7 @@
Matches a node if the declaration associated with that node matches the given matcher. @@ -4621,7 +4621,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches if the expression's or declaration's type matches a type +matcher. + +Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X"))))) + and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X"))))) + and U (matcher = typedefDecl(hasType(asString("int"))) + class X {}; + void y(X &x) { x; X z; } + typedef int U; +
Overloaded to match the declaration of the expression's or value declaration's type. @@ -4654,19 +4667,6 @@
Matches if the expression's or declaration's type matches a type -matcher. - -Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X"))))) - and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X"))))) - and U (matcher = typedefDecl(hasType(asString("int"))) - class X {}; - void y(X &x) { x; X z; } - typedef int U; -
Matches expressions that match InnerMatcher after any implicit casts are stripped off. @@ -4951,7 +4951,7 @@
Matches a node if the declaration associated with that node matches the given matcher. @@ -4969,13 +4969,13 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches a node if the declaration associated with that node matches the given matcher. @@ -4993,13 +4993,13 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches a node if the declaration associated with that node matches the given matcher. @@ -5017,7 +5017,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches an OverloadExpr if any of the declarations in the set of overloads matches the given matcher. @@ -5259,7 +5259,7 @@
Matches a node if the declaration associated with that node matches the given matcher. @@ -5277,7 +5277,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Overloaded to match the pointee type's declaration. -
Matches if the matched type is a pointer type and the pointee type matches the specified matcher. @@ -5311,8 +5306,8 @@
Overloaded to match the referenced type's declaration. ++ Matcher<QualType> pointsTo Matcher<Decl> InnerMatcher @@ -5331,7 +5326,12 @@ Overloaded to match the pointee type's declaration.
Overloaded to match the referenced type's declaration. +
Matches a node if the declaration associated with that node matches the given matcher. @@ -5349,7 +5349,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches a node if the declaration associated with that node matches the given matcher. @@ -5492,7 +5492,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches a canonical TemplateArgument that refers to a certain declaration. @@ -5565,7 +5565,7 @@
Matches classTemplateSpecializations, templateSpecializationType and functionDecl that have at least one TemplateArgument matching the given InnerMatcher. @@ -5587,7 +5587,7 @@
Matches a node if the declaration associated with that node matches the given matcher. @@ -5605,13 +5605,13 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches classTemplateSpecializations, templateSpecializationType and functionDecl where the n'th TemplateArgument matches the given InnerMatcher. @@ -5631,7 +5631,7 @@
Matches a node if the declaration associated with that node matches the given matcher. @@ -5649,7 +5649,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches a node if the declaration associated with that node matches the given matcher. @@ -5702,7 +5702,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches a node if the declaration associated with that node matches the given matcher. @@ -5757,7 +5757,7 @@ Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, Matcher<TemplateTypeParmType>, Matcher<TypedefType>, Matcher<UnresolvedUsingType>
Matches if the expression's or declaration's type matches a type +matcher. + +Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X"))))) + and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X"))))) + and U (matcher = typedefDecl(hasType(asString("int"))) + class X {}; + void y(X &x) { x; X z; } + typedef int U; +
Overloaded to match the declaration of the expression's or value declaration's type. @@ -5804,19 +5817,6 @@
Matches if the expression's or declaration's type matches a type -matcher. - -Example matches x (matcher = expr(hasType(cxxRecordDecl(hasName("X"))))) - and z (matcher = varDecl(hasType(cxxRecordDecl(hasName("X"))))) - and U (matcher = typedefDecl(hasType(asString("int"))) - class X {}; - void y(X &x) { x; X z; } - typedef int U; -
Matches a variable declaration that has an initializer expression that matches the given matcher.