Index: clang/docs/LibASTMatchersReference.html =================================================================== --- clang/docs/LibASTMatchersReference.html +++ clang/docs/LibASTMatchersReference.html @@ -516,6 +516,16 @@ +Matcher<Decl>templateTemplateParmDeclMatcher<TemplateTemplateParmDecl>... +
Matches template template parameter declarations.
+
+Given
+  template <template <typename> class Z, int N> struct C {};
+templateTypeParmDecl()
+  matches 'Z', but not 'N'.
+
+ + Matcher<Decl>templateTypeParmDeclMatcher<TemplateTypeParmDecl>...
Matches template type parameter declarations.
 
@@ -661,18 +671,6 @@
 
-Matcher<DecompositionDecl>decompositionDeclMatcher<DecompositionDecl>... -
Matches decomposition-declarations.
-
-Examples matches the declaration node with foo and bar, but not
-number.
-(matcher = declStmt(has(decompositionDecl())))
-
-  int number = 42;
-  auto [foo, bar] = std::make_pair{42, 42};
-
- - Matcher<NestedNameSpecifierLoc>nestedNameSpecifierLocMatcher<NestedNameSpecifierLoc>...
Same as nestedNameSpecifier but matches NestedNameSpecifierLoc.
 
@@ -5373,33 +5371,6 @@ -Matcher<CXXConstructExpr>forEachArgumentWithParamTypeMatcher<Expr> ArgMatcher, Matcher<QualType> ParamMatcher -
Matches all arguments and their respective types for a CallExpr or
-CXXConstructExpr. It is very similar to forEachArgumentWithParam but
-it works on calls through function pointers as well.
-
-The difference is, that function pointers do not provide access to a
-ParmVarDecl, but only the QualType for each argument.
-
-Given
-  void f(int i);
-  int y;
-  f(y);
-  void (*f_ptr)(int) = f;
-  f_ptr(y);
-callExpr(
-  forEachArgumentWithParamType(
-    declRefExpr(to(varDecl(hasName("y")))),
-    qualType(isInteger()).bind("type)
-))
-  matches f(y) and f_ptr(y)
-with declRefExpr(...)
-  matching int y
-and qualType(...)
-  matching int
-
- - Matcher<CXXConstructExpr>hasAnyArgumentMatcher<Expr> InnerMatcher
Matches any argument of a call expression or a constructor call
 expression, or an ObjC-message-send expression.
@@ -5539,16 +5510,7 @@
 
 
 Matcher<CXXForRangeStmt>hasBodyMatcher<Stmt> InnerMatcher
-
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<CXXForRangeStmt>hasInitStatementMatcher<Stmt> InnerMatcher
@@ -5955,33 +5917,6 @@
 
-Matcher<CallExpr>forEachArgumentWithParamTypeMatcher<Expr> ArgMatcher, Matcher<QualType> ParamMatcher -
Matches all arguments and their respective types for a CallExpr or
-CXXConstructExpr. It is very similar to forEachArgumentWithParam but
-it works on calls through function pointers as well.
-
-The difference is, that function pointers do not provide access to a
-ParmVarDecl, but only the QualType for each argument.
-
-Given
-  void f(int i);
-  int y;
-  f(y);
-  void (*f_ptr)(int) = f;
-  f_ptr(y);
-callExpr(
-  forEachArgumentWithParamType(
-    declRefExpr(to(varDecl(hasName("y")))),
-    qualType(isInteger()).bind("type)
-))
-  matches f(y) and f_ptr(y)
-with declRefExpr(...)
-  matching int y
-and qualType(...)
-  matching int
-
- - Matcher<CallExpr>hasAnyArgumentMatcher<Expr> InnerMatcher
Matches any argument of a call expression or a constructor call
 expression, or an ObjC-message-send expression.
@@ -6154,7 +6089,7 @@
 
 
 Matcher<DecayedType>hasDecayedTypeMatcher<QualType> InnerType
-
Matches the decayed type, whos decayed type matches InnerMatcher
+
Matches the decayed type, whoes decayed type matches InnerMatcher
 
@@ -6290,16 +6225,7 @@ Matcher<DoStmt>hasBodyMatcher<Stmt> InnerMatcher -
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<DoStmt>hasConditionMatcher<Expr> InnerMatcher
@@ -6566,16 +6492,7 @@
 
 
 Matcher<ForStmt>hasBodyMatcher<Stmt> InnerMatcher
-
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<ForStmt>hasConditionMatcher<Expr> InnerMatcher
@@ -6649,6 +6566,24 @@
 
+Matcher<FunctionDecl>hasAnyBodyMatcher<Stmt> InnerMatcher +
Matches a function declaration that has a given body present in the AST.
+Note that this matcher matches all the declarations of a function whose
+body is present in the AST.
+
+Given
+  void f();
+  void f() {}
+  void g();
+hasAnyBody(functionDecl())
+  matches both 'void f();'
+  and 'void f() {}'
+with compoundStmt()
+  matching '{}'
+  but does not match 'void g();'
+
+ + Matcher<FunctionDecl>hasAnyParameterMatcher<ParmVarDecl> InnerMatcher
Matches any parameter of a function or an ObjC method declaration or a
 block.
@@ -6701,16 +6636,7 @@
 
 
 Matcher<FunctionDecl>hasBodyMatcher<Stmt> InnerMatcher
-
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<FunctionDecl>hasExplicitSpecifierMatcher<Expr> InnerMatcher
@@ -7694,7 +7620,7 @@
 
 
 Matcher<TemplateArgument>refersToIntegralTypeMatcher<QualType> InnerMatcher
-
Matches a TemplateArgument that referes to an integral type.
+
Matches a TemplateArgument that refers to an integral type.
 
 Given
   template<int T> struct C {};
@@ -8068,16 +7994,7 @@
 
 
 Matcher<WhileStmt>hasBodyMatcher<Stmt> InnerMatcher
-
Matches a 'for', 'while', 'do while' statement or a function
-definition that has a given body.
-
-Given
-  for (;;) {}
-hasBody(compoundStmt())
-  matches 'for (;;) {}'
-with compoundStmt()
-  matching '{}'
-
+

 
 
 Matcher<WhileStmt>hasConditionMatcher<Expr> InnerMatcher
Index: clang/include/clang/ASTMatchers/ASTMatchers.h
===================================================================
--- clang/include/clang/ASTMatchers/ASTMatchers.h
+++ clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -1162,7 +1162,7 @@
   return Node.getKind() == TemplateArgument::Integral;
 }
 
-/// Matches a TemplateArgument that referes to an integral type.
+/// Matches a TemplateArgument that refers to an integral type.
 ///
 /// Given
 /// \code
@@ -6572,7 +6572,7 @@
 /// \endcode
 extern const AstTypeMatcher decayedType;
 
-/// Matches the decayed type, whos decayed type matches \c InnerMatcher
+/// Matches the decayed type, whoes decayed type matches \c InnerMatcher
 AST_MATCHER_P(DecayedType, hasDecayedType, internal::Matcher,
               InnerType) {
   return InnerType.matches(Node.getDecayedType(), Finder, Builder);