diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index 9b30057b5257f..5b2a96d00d592 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -1028,6 +1028,15 @@

Node Matchers

+Matcher<Decl>requiresExprBodyDeclMatcher<RequiresExprBodyDecl>... +
Matches concept requirement body declaration.
+
+Example matches '{ *p; }'
+  template<typename T>
+  concept dereferencable = requires(T p) { *p; }
+
+ + Matcher<Decl>staticAssertDeclMatcher<StaticAssertDecl>...
Matches a C++ static_assert declaration.
 
@@ -1190,6 +1199,17 @@ 

Node Matchers

matches using enum X::x
+Matcher<Decl>usingShadowDeclMatcher<UsingShadowDecl>... +
Matches shadow declarations introduced into a scope by a
+       (resolved) using declaration.
+
+Given
+  namespace n { int f; }
+  namespace declToImport { using n::f; }
+usingShadowDecl()
+  matches f 
+ + Matcher<Decl>valueDeclMatcher<ValueDecl>...
Matches any value declaration.
 
@@ -1210,6 +1230,15 @@ 

Node Matchers

+Matcher<Expr>requiresExprMatcher<RequiresExpr>... +
Matches concept requirement.
+
+Example matches 'requires(T p) { *p; }'
+  template<typename T>
+  concept dereferencable = requires(T p) { *p; }
+
+ + Matcher<LambdaCapture>lambdaCaptureMatcher<LambdaCapture>...
Matches lambda captures.
 
@@ -1679,6 +1708,19 @@ 

Node Matchers

+Matcher<Stmt>cxxNamedCastExprMatcher<CXXNamedCastExpr>... +
Matches any named cast expression.
+
+Example: Matches all four of the casts in
+  struct S { virtual void f(); };
+  S* p = nullptr;
+  S* ptr1 = static_cast<S*>(p);
+  S* ptr2 = reinterpret_cast<S*>(p);
+  S* ptr3 = dynamic_cast<S*>(p);
+  S* ptr4 = const_cast<S*>(p);
+
+ + Matcher<Stmt>cxxNewExprMatcher<CXXNewExpr>...
Matches new expressions.
 
@@ -2168,7 +2210,7 @@ 

Node Matchers

-Matcher<Stmt>ompExecutableDirectiveMatcher<OMPExecutableDirective>... +Matcher<Stmt>ompExecutableDirectiveMatcher<OMPExecutableDirective>...
Matches any ``#pragma omp`` executable directive.
 
 Given
@@ -2393,17 +2435,6 @@ 

Node Matchers

-Matcher<TypeLoc>elaboratedTypeLocMatcher<ElaboratedTypeLoc>... -
Matches C or C++ elaborated `TypeLoc`s.
-
-Given
-  struct s {};
-  struct s ss;
-elaboratedTypeLoc()
-  matches the `TypeLoc` of the variable declaration of `ss`.
-
- - Matcher<TypeLoc>pointerTypeLocMatcher<PointerTypeLoc>...
Matches pointer `TypeLoc`s.
 
@@ -2474,7 +2505,7 @@ 

Node Matchers

-Matcher<Type>autoTypeMatcher<AutoType>... +Matcher<Type>autoTypeMatcher<AutoType>...
Matches types nodes representing C++11 auto types.
 
 Given:
@@ -2544,7 +2575,7 @@ 

Node Matchers

-Matcher<Type>decltypeTypeMatcher<DecltypeType>... +Matcher<Type>decltypeTypeMatcher<DecltypeType>...
Matches types nodes representing C++11 decltype(<expr>) types.
 
 Given:
@@ -2556,7 +2587,7 @@ 

Node Matchers

-Matcher<Type>deducedTemplateSpecializationTypeMatcher<DeducedTemplateSpecializationType>... +Matcher<Type>deducedTemplateSpecializationTypeMatcher<DeducedTemplateSpecializationType>...
Matches C++17 deduced template specialization types, e.g. deduced class
 template types.
 
@@ -2570,7 +2601,7 @@ 

Node Matchers

-Matcher<Type>dependentNameTypeMatcher<DependentNameType>... +Matcher<Type>dependentNameTypeMatcher<DependentNameType>...
Matches a dependent name type
 
 Example matches T::type
@@ -2607,38 +2638,7 @@ 

Node Matchers

-Matcher<Type>dependentTemplateSpecializationTypeMatcher<DependentTemplateSpecializationType>... -
Matches a dependent template specialization type
-
-Example matches A<T>::template B<T>
-  template<typename T> struct A;
-  template<typename T> struct declToImport {
-    typename A<T>::template B<T> a;
-  };
-
- - -Matcher<Type>elaboratedTypeMatcher<ElaboratedType>... -
Matches types specified with an elaborated type keyword or with a
-qualified name.
-
-Given
-  namespace N {
-    namespace M {
-      class D {};
-    }
-  }
-  class C {};
-
-  class C c;
-  N::M::D d;
-
-elaboratedType() matches the type of the variable declarations of both
-c and d.
-
- - -Matcher<Type>enumTypeMatcher<EnumType>... +Matcher<Type>enumTypeMatcher<EnumType>...
Matches enum types.
 
 Given
@@ -2688,7 +2688,7 @@ 

Node Matchers

-Matcher<Type>injectedClassNameTypeMatcher<InjectedClassNameType>... +Matcher<Type>injectedClassNameTypeMatcher<InjectedClassNameType>...
Matches injected class name types.
 
 Example matches S s, but not S<T> s.
@@ -2800,7 +2800,7 @@ 

Node Matchers

-Matcher<Type>recordTypeMatcher<RecordType>... +Matcher<Type>recordTypeMatcher<RecordType>...
Matches record types (e.g. structs, classes).
 
 Given
@@ -2831,7 +2831,7 @@ 

Node Matchers

-Matcher<Type>substTemplateTypeParmTypeMatcher<SubstTemplateTypeParmType>... +Matcher<Type>substTemplateTypeParmTypeMatcher<SubstTemplateTypeParmType>...
Matches types that represent the result of substituting a type for a
 template type parameter.
 
@@ -2845,7 +2845,7 @@ 

Node Matchers

-Matcher<Type>tagTypeMatcher<TagType>... +Matcher<Type>tagTypeMatcher<TagType>...
Matches tag types (record and enum types).
 
 Given
@@ -2860,7 +2860,7 @@ 

Node Matchers

-Matcher<Type>templateSpecializationTypeMatcher<TemplateSpecializationType>... +Matcher<Type>templateSpecializationTypeMatcher<TemplateSpecializationType>...
Matches template specialization types.
 
 Given
@@ -2875,7 +2875,7 @@ 

Node Matchers

-Matcher<Type>templateTypeParmTypeMatcher<TemplateTypeParmType>... +Matcher<Type>templateTypeParmTypeMatcher<TemplateTypeParmType>...
Matches template type parameter types.
 
 Example matches T, but not int.
@@ -2899,7 +2899,7 @@ 

Node Matchers

-Matcher<Type>unaryTransformTypeMatcher<UnaryTransformType>... +Matcher<Type>unaryTransformTypeMatcher<UnaryTransformType>...
Matches types nodes representing unary type transformations.
 
 Given:
@@ -3077,8 +3077,8 @@ 

Narrowing Matchers

Matcher<CXXBaseSpecifier>isPrivate -
Matches private C++ declarations and C++ base specifers that specify private
-inheritance.
+
Matches private C++ declarations and C++ base specifiers that specify
+private inheritance.
 
 Examples:
   class C {
@@ -3094,7 +3094,7 @@ 

Narrowing Matchers

Matcher<CXXBaseSpecifier>isProtected -
Matches protected C++ declarations and C++ base specifers that specify
+
Matches protected C++ declarations and C++ base specifiers that specify
 protected inheritance.
 
 Examples:
@@ -3110,7 +3110,7 @@ 

Narrowing Matchers

Matcher<CXXBaseSpecifier>isPublic -
Matches public C++ declarations and C++ base specifers that specify public
+
Matches public C++ declarations and C++ base specifiers that specify public
 inheritance.
 
 Examples:
@@ -3127,7 +3127,7 @@ 

Narrowing Matchers

Matcher<CXXBaseSpecifier>isVirtual -
Matches declarations of virtual methods and C++ base specifers that specify
+
Matches declarations of virtual methods and C++ base specifiers that specify
 virtual inheritance.
 
 Example:
@@ -3709,7 +3709,7 @@ 

Narrowing Matchers

Matcher<CXXMethodDecl>isVirtual -
Matches declarations of virtual methods and C++ base specifers that specify
+
Matches declarations of virtual methods and C++ base specifiers that specify
 virtual inheritance.
 
 Example:
@@ -4161,6 +4161,12 @@ 

Narrowing Matchers

+Matcher<Decl>declaresSameEntityAsBoundNodestd::string ID +
Matches a declaration if it declares the same entity as the node previously
+bound to ID.
+
+ + Matcher<Decl>equalsBoundNodestd::string ID
Matches if a node equals a previously bound node.
 
@@ -4322,8 +4328,8 @@ 

Narrowing Matchers

Matcher<Decl>isPrivate -
Matches private C++ declarations and C++ base specifers that specify private
-inheritance.
+
Matches private C++ declarations and C++ base specifiers that specify
+private inheritance.
 
 Examples:
   class C {
@@ -4339,7 +4345,7 @@ 

Narrowing Matchers

Matcher<Decl>isProtected -
Matches protected C++ declarations and C++ base specifers that specify
+
Matches protected C++ declarations and C++ base specifiers that specify
 protected inheritance.
 
 Examples:
@@ -4355,7 +4361,7 @@ 

Narrowing Matchers

Matcher<Decl>isPublic -
Matches public C++ declarations and C++ base specifers that specify public
+
Matches public C++ declarations and C++ base specifiers that specify public
 inheritance.
 
 Examples:
@@ -4371,7 +4377,7 @@ 

Narrowing Matchers

-Matcher<DependentNameType>hasDependentNamestd::string N +Matcher<DependentNameType>hasDependentNamestd::string N
Matches the dependent name of a DependentScopeDeclRefExpr or
 DependentNameType
 
@@ -5046,7 +5052,7 @@ 

Narrowing Matchers

int z; Example matches f() because it has external formal linkage despite being -unique to the translation unit as though it has internal likage +unique to the translation unit as though it has internal linkage (matcher = functionDecl(hasExternalFormalLinkage())) namespace { @@ -5182,7 +5188,7 @@

Narrowing Matchers

-Matcher<OMPExecutableDirective>isAllowedToContainClauseKindOpenMPClauseKind CKind +Matcher<OMPExecutableDirective>isAllowedToContainClauseKindOpenMPClauseKind CKind
Matches if the OpenMP directive is allowed to contain the specified OpenMP
 clause kind.
 
@@ -5192,7 +5198,7 @@ 

Narrowing Matchers

#pragma omp parallel for #pragma omp for -`ompExecutableDirective(isAllowedToContainClause(OMPC_default))`` matches +``ompExecutableDirective(isAllowedToContainClause(OMPC_default))`` matches ``omp parallel`` and ``omp parallel for``. If the matcher is use from clang-query, ``OpenMPClauseKind`` parameter @@ -5201,7 +5207,7 @@

Narrowing Matchers

-Matcher<OMPExecutableDirective>isStandaloneDirective +Matcher<OMPExecutableDirective>isStandaloneDirective
Matches standalone OpenMP directives,
 i.e., directives that can't have a structured block.
 
@@ -5545,10 +5551,10 @@ 

Narrowing Matchers

Given void a(int); - void b(long); + void b(unsigned long); void c(double); functionDecl(hasAnyParameter(hasType(isInteger()))) -matches "a(int)", "b(long)", but not "c(double)". +matches "a(int)", "b(unsigned long)", but not "c(double)".
@@ -5781,7 +5787,7 @@

Narrowing Matchers

Matches a TemplateArgument of integral type with a given value.
 
 Note that 'Value' is a string as the template argument's value is
-an arbitrary precision integer. 'Value' must be euqal to the canonical
+an arbitrary precision integer. 'Value' must be equal to the canonical
 representation of that integral value in base 10.
 
 Given
@@ -5806,7 +5812,7 @@ 

Narrowing Matchers

-Matcher<TemplateSpecializationType>templateArgumentCountIsunsigned N +Matcher<TemplateSpecializationType>templateArgumentCountIsunsigned N
Matches if the number of template arguments equals N.
 
 Given
@@ -6571,8 +6577,8 @@ 

AST Traversal Matchers

Matcher<AbstractConditionalOperator>hasConditionMatcher<Expr> InnerMatcher -
Matches the condition expression of an if statement, for loop,
-switch statement or conditional operator.
+
Matches the condition expression of an if statement, for loop, while loop,
+do-while loop, switch statement or conditional operator.
 
 Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
   if (true) {}
@@ -6600,8 +6606,8 @@ 

AST Traversal Matchers

-Matcher<AddrLabelExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<AddrLabelExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -6626,11 +6632,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -6701,7 +6707,7 @@

AST Traversal Matchers

-Matcher<AutoType>hasDeducedTypeMatcher<Type> +Matcher<AutoType>hasDeducedTypeMatcher<Type>
Matches AutoType nodes where the deduced type is a specific type.
 
 Note: There is no TypeLoc for the deduced type and thus no
@@ -6713,7 +6719,7 @@ 

AST Traversal Matchers

autoType(hasDeducedType(isInteger())) matches "auto a" -Usable as: Matcher<AutoType> +Usable as: Matcher<AutoType>
@@ -7026,8 +7032,8 @@

AST Traversal Matchers

-Matcher<CXXConstructExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<CXXConstructExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -7052,11 +7058,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -7489,8 +7495,8 @@

AST Traversal Matchers

-Matcher<CXXNewExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<CXXNewExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -7515,11 +7521,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -7952,8 +7958,8 @@

AST Traversal Matchers

-Matcher<CallExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<CallExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -7978,11 +7984,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -8204,7 +8210,7 @@

AST Traversal Matchers

Matcher<DecayedType>hasDecayedTypeMatcher<QualType> InnerType -
Matches the decayed type, whoes decayed type matches InnerMatcher
+
Matches the decayed type, whose decayed type matches InnerMatcher
 
@@ -8223,8 +8229,8 @@

AST Traversal Matchers

-Matcher<DeclRefExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<DeclRefExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -8249,11 +8255,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -8373,24 +8379,11 @@

AST Traversal Matchers

} } -cxxRcordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the +cxxRecordDecl(hasDeclContext(namedDecl(hasName("M")))) matches the declaration of class D.
-Matcher<DecltypeType>hasUnderlyingTypeMatcher<Type> -
Matches DecltypeType or UsingType nodes to find the underlying type.
-
-Given
-  decltype(1) a = 1;
-  decltype(2.0) b = 2.0;
-decltypeType(hasUnderlyingType(isInteger()))
-  matches the type of "a"
-
-Usable as: Matcher<DecltypeType>, Matcher<UsingType>
-
- - Matcher<DecompositionDecl>hasAnyBindingMatcher<BindingDecl> InnerMatcher
Matches any binding of a DecompositionDecl.
 
@@ -8451,66 +8444,16 @@ 

AST Traversal Matchers

Matcher<DoStmt>hasConditionMatcher<Expr> InnerMatcher -
Matches the condition expression of an if statement, for loop,
-switch statement or conditional operator.
+
Matches the condition expression of an if statement, for loop, while loop,
+do-while loop, switch statement or conditional operator.
 
 Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
   if (true) {}
 
-Matcher<ElaboratedTypeLoc>hasNamedTypeLocMatcher<TypeLoc> InnerMatcher -
Matches elaborated `TypeLoc`s that have a named `TypeLoc` matching
-`InnerMatcher`.
-
-Given
-  template <typename T>
-  class C {};
-  class C<int> c;
-
-  class D {};
-  class D d;
-elaboratedTypeLoc(hasNamedTypeLoc(templateSpecializationTypeLoc()));
-  matches the `TypeLoc` of the variable declaration of `c`, but not `d`.
-
- - -Matcher<ElaboratedType>hasQualifierMatcher<NestedNameSpecifier> InnerMatcher -
Matches ElaboratedTypes whose qualifier, a NestedNameSpecifier,
-matches InnerMatcher if the qualifier exists.
-
-Given
-  namespace N {
-    namespace M {
-      class D {};
-    }
-  }
-  N::M::D d;
-
-elaboratedType(hasQualifier(hasPrefix(specifiesNamespace(hasName("N"))))
-matches the type of the variable declaration of d.
-
- - -Matcher<ElaboratedType>namesTypeMatcher<QualType> InnerMatcher -
Matches ElaboratedTypes whose named type matches InnerMatcher.
-
-Given
-  namespace N {
-    namespace M {
-      class D {};
-    }
-  }
-  N::M::D d;
-
-elaboratedType(namesType(recordType(
-hasDeclaration(namedDecl(hasName("D")))))) matches the type of the variable
-declaration of d.
-
- - -Matcher<EnumType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<EnumType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -8535,11 +8478,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -8788,14 +8731,26 @@

AST Traversal Matchers

Matcher<ForStmt>hasConditionMatcher<Expr> InnerMatcher -
Matches the condition expression of an if statement, for loop,
-switch statement or conditional operator.
+
Matches the condition expression of an if statement, for loop, while loop,
+do-while loop, switch statement or conditional operator.
 
 Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
   if (true) {}
 
+Matcher<ForStmt>hasConditionVariableStatementMatcher<DeclStmt> InnerMatcher +
Matches the condition variable statement in an if statement, for loop,
+while loop or switch statement.
+
+Given
+  if (A* a = GetAPointer()) {}
+  for (; A* a = GetAPointer(); ) {}
+hasConditionVariableStatement(...)
+  matches both 'A* a = GetAPointer()'.
+
+ + Matcher<ForStmt>hasIncrementMatcher<Stmt> InnerMatcher
Matches the increment statement of a for loop.
 
@@ -9099,8 +9054,8 @@ 

AST Traversal Matchers

Matcher<IfStmt>hasConditionMatcher<Expr> InnerMatcher -
Matches the condition expression of an if statement, for loop,
-switch statement or conditional operator.
+
Matches the condition expression of an if statement, for loop, while loop,
+do-while loop, switch statement or conditional operator.
 
 Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
   if (true) {}
@@ -9108,12 +9063,14 @@ 

AST Traversal Matchers

Matcher<IfStmt>hasConditionVariableStatementMatcher<DeclStmt> InnerMatcher -
Matches the condition variable statement in an if statement.
+
Matches the condition variable statement in an if statement, for loop,
+while loop or switch statement.
 
 Given
   if (A* a = GetAPointer()) {}
+  for (; A* a = GetAPointer(); ) {}
 hasConditionVariableStatement(...)
-  matches 'A* a = GetAPointer()'.
+  matches both 'A* a = GetAPointer()'.
 
@@ -9179,8 +9136,8 @@

AST Traversal Matchers

-Matcher<InjectedClassNameType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<InjectedClassNameType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -9205,16 +9162,16 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
-Matcher<LabelStmt>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<LabelStmt>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -9239,11 +9196,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -9293,8 +9250,8 @@

AST Traversal Matchers

-Matcher<MemberExpr>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<MemberExpr>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -9319,11 +9276,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -9456,7 +9413,7 @@

AST Traversal Matchers

-Matcher<OMPExecutableDirective>hasAnyClauseMatcher<OMPClause> InnerMatcher +Matcher<OMPExecutableDirective>hasAnyClauseMatcher<OMPClause> InnerMatcher
Matches any clause in an OpenMP directive.
 
 Given
@@ -9469,7 +9426,7 @@ 

AST Traversal Matchers

-Matcher<OMPExecutableDirective>hasStructuredBlockMatcher<Stmt> InnerMatcher +Matcher<OMPExecutableDirective>hasStructuredBlockMatcher<Stmt> InnerMatcher
Matches the structured-block of the OpenMP executable directive
 
 Prerequisite: the executable directive must not be standalone directive.
@@ -9826,8 +9783,8 @@ 

AST Traversal Matchers

-Matcher<QualType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<QualType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -9852,11 +9809,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -9920,8 +9877,8 @@

AST Traversal Matchers

-Matcher<RecordType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<RecordType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -9946,11 +9903,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -10066,7 +10023,7 @@

AST Traversal Matchers

-Matcher<SubstTemplateTypeParmType>hasReplacementTypeMatcher<Type> +Matcher<SubstTemplateTypeParmType>hasReplacementTypeMatcher<Type>
Matches template type parameter substitutions that have a replacement
 type that matches the provided matcher.
 
@@ -10094,14 +10051,26 @@ 

AST Traversal Matchers

Matcher<SwitchStmt>hasConditionMatcher<Expr> InnerMatcher -
Matches the condition expression of an if statement, for loop,
-switch statement or conditional operator.
+
Matches the condition expression of an if statement, for loop, while loop,
+do-while loop, switch statement or conditional operator.
 
 Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
   if (true) {}
 
+Matcher<SwitchStmt>hasConditionVariableStatementMatcher<DeclStmt> InnerMatcher +
Matches the condition variable statement in an if statement, for loop,
+while loop or switch statement.
+
+Given
+  if (A* a = GetAPointer()) {}
+  for (; A* a = GetAPointer(); ) {}
+hasConditionVariableStatement(...)
+  matches both 'A* a = GetAPointer()'.
+
+ + Matcher<SwitchStmt>hasInitStatementMatcher<Stmt> InnerMatcher
Matches selection statements with initializer.
 
@@ -10125,8 +10094,8 @@ 

AST Traversal Matchers

-Matcher<TagType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<TagType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -10151,11 +10120,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -10284,7 +10253,7 @@

AST Traversal Matchers

-Matcher<TemplateSpecializationType>forEachTemplateArgumentMatcher<TemplateArgument> InnerMatcher +Matcher<TemplateSpecializationType>forEachTemplateArgumentMatcher<TemplateArgument> InnerMatcher
Matches templateSpecializationType, class template specialization,
 variable template specialization, and function template specialization
 nodes where the template argument matches the inner matcher. This matcher
@@ -10310,7 +10279,7 @@ 

AST Traversal Matchers

-Matcher<TemplateSpecializationType>hasAnyTemplateArgumentMatcher<TemplateArgument> InnerMatcher +Matcher<TemplateSpecializationType>hasAnyTemplateArgumentMatcher<TemplateArgument> InnerMatcher
Matches templateSpecializationTypes, class template specializations,
 variable template specializations, and function template specializations
 that have at least one TemplateArgument matching the given InnerMatcher.
@@ -10332,8 +10301,8 @@ 

AST Traversal Matchers

-Matcher<TemplateSpecializationType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<TemplateSpecializationType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -10358,15 +10327,15 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
-Matcher<TemplateSpecializationType>hasTemplateArgumentunsigned N, Matcher<TemplateArgument> InnerMatcher +Matcher<TemplateSpecializationType>hasTemplateArgumentunsigned N, Matcher<TemplateArgument> InnerMatcher
Matches templateSpecializationType, class template specializations,
 variable template specializations, and function template specializations
 where the n'th TemplateArgument matches the given InnerMatcher.
@@ -10387,8 +10356,8 @@ 

AST Traversal Matchers

-Matcher<TemplateTypeParmType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<TemplateTypeParmType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -10413,11 +10382,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -10473,8 +10442,8 @@

AST Traversal Matchers

-Matcher<TypedefType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<TypedefType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -10499,11 +10468,41 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType> +
+ + +Matcher<Type>hasQualifierMatcher<NestedNameSpecifier> InnerMatcher +
Matches Types whose qualifier, a NestedNameSpecifier,
+matches InnerMatcher if the qualifier exists.
+
+Given
+  namespace N {
+    namespace M {
+      class D {};
+    }
+  }
+  N::M::D d;
+
+elaboratedType(hasQualifier(hasPrefix(specifiesNamespace(hasName("N"))))
+matches the type of the variable declaration of d.
+
+ + +Matcher<Type>hasUnderlyingTypeMatcher<QualType> Inner +
Matches QualType nodes to find the underlying type.
+
+Given
+  decltype(1) a = 1;
+  decltype(2.0) b = 2.0;
+decltypeType(hasUnderlyingType(isInteger()))
+  matches the type of "a"
+
+Usable as: Matcher<QualType>
 
@@ -10556,8 +10555,8 @@

AST Traversal Matchers

-Matcher<UnresolvedUsingType>hasDeclarationMatcher<Decl> InnerMatcher -
Matches a node if the declaration associated with that node
+Matcher<UnresolvedUsingType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
 matches the given matcher.
 
 The associated declaration is:
@@ -10582,11 +10581,11 @@ 

AST Traversal Matchers

Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>, Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>, - Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, - Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, - Matcher<TagType>, Matcher<TemplateSpecializationType>, - Matcher<TemplateTypeParmType>, Matcher<TypedefType>, - Matcher<UnresolvedUsingType> + Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>, + Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>, + Matcher<TagType>, Matcher<TemplateSpecializationType>, + Matcher<TemplateTypeParmType>, Matcher<TypedefType>, + Matcher<UnresolvedUsingType>, Matcher<UsingType>
@@ -10602,16 +10601,37 @@

AST Traversal Matchers

matches using X::b but not using X::a
-Matcher<UsingType>hasUnderlyingTypeMatcher<Type> -
Matches DecltypeType or UsingType nodes to find the underlying type.
+Matcher<UsingType>hasDeclarationMatcher<Decl>  InnerMatcher
+
Matches a node if the declaration associated with that node
+matches the given matcher.
 
-Given
-  decltype(1) a = 1;
-  decltype(2.0) b = 2.0;
-decltypeType(hasUnderlyingType(isInteger()))
-  matches the type of "a"
+The associated declaration is:
+- for type nodes, the declaration of the underlying type
+- for CallExpr, the declaration of the callee
+- for MemberExpr, the declaration of the referenced member
+- for CXXConstructExpr, the declaration of the constructor
+- for CXXNewExpr, the declaration of the operator new
+- for ObjCIvarExpr, the declaration of the ivar
+
+For type nodes, hasDeclaration will generally match the declaration of the
+sugared type. Given
+  class X {};
+  typedef X Y;
+  Y y;
+in varDecl(hasType(hasDeclaration(decl()))) the decl will match the
+typedefDecl. A common use case is to match the underlying, desugared type.
+This can be achieved by using the hasUnqualifiedDesugaredType matcher:
+  varDecl(hasType(hasUnqualifiedDesugaredType(
+      recordType(hasDeclaration(decl())))))
+In this matcher, the decl will match the CXXRecordDecl of class X.
 
-Usable as: Matcher<DecltypeType>, Matcher<UsingType>
+Usable as: Matcher<AddrLabelExpr>, Matcher<CallExpr>,
+  Matcher<CXXConstructExpr>, Matcher<CXXNewExpr>, Matcher<DeclRefExpr>,
+  Matcher<EnumType>, Matcher<InjectedClassNameType>, Matcher<LabelStmt>,
+  Matcher<MemberExpr>, Matcher<QualType>, Matcher<RecordType>,
+  Matcher<TagType>, Matcher<TemplateSpecializationType>,
+  Matcher<TemplateTypeParmType>, Matcher<TypedefType>,
+  Matcher<UnresolvedUsingType>, Matcher<UsingType>
 
@@ -10832,13 +10852,25 @@

AST Traversal Matchers

Matcher<WhileStmt>hasConditionMatcher<Expr> InnerMatcher -
Matches the condition expression of an if statement, for loop,
-switch statement or conditional operator.
+
Matches the condition expression of an if statement, for loop, while loop,
+do-while loop, switch statement or conditional operator.
 
 Example matches true (matcher = hasCondition(cxxBoolLiteral(equals(true))))
   if (true) {}
 
+ +Matcher<WhileStmt>hasConditionVariableStatementMatcher<DeclStmt> InnerMatcher +
Matches the condition variable statement in an if statement, for loop,
+while loop or switch statement.
+
+Given
+  if (A* a = GetAPointer()) {}
+  for (; A* a = GetAPointer(); ) {}
+hasConditionVariableStatement(...)
+  matches both 'A* a = GetAPointer()'.
+
+