Index: clang/docs/LibASTMatchersReference.html =================================================================== --- clang/docs/LibASTMatchersReference.html +++ clang/docs/LibASTMatchersReference.html @@ -1455,6 +1455,16 @@ +
Matches coroutine body statements. + +coroutineBodyStmt() matches the coroutine below + generator<int> gen() { + co_return; + } +
Matches co_yield expressions. @@ -3037,10 +3047,11 @@- Matcher<CXXConstructExpr> argumentCountAtLeast unsigned N Checks that a call expression or a constructor call expression has -at least the specified number of arguments (including absent default arguments). + Checks that a call expression or a constructor call expression has at least +the specified number of arguments (including absent default arguments). -Example matches f(0, 0) and g(0, 0, 0) (matcher = callExpr(argumentCountAtLeast(2))) +Example matches f(0, 0) and g(0, 0, 0) +(matcher = callExpr(argumentCountAtLeast(2))) void f(int x, int y); void g(int x, int y, int z); f(0, 0); @@ -3706,10 +3717,11 @@- Matcher<CXXUnresolvedConstructExpr> argumentCountAtLeast unsigned N Checks that a call expression or a constructor call expression has -at least the specified number of arguments (including absent default arguments). + Checks that a call expression or a constructor call expression has at least +the specified number of arguments (including absent default arguments). -Example matches f(0, 0) and g(0, 0, 0) (matcher = callExpr(argumentCountAtLeast(2))) +Example matches f(0, 0) and g(0, 0, 0) +(matcher = callExpr(argumentCountAtLeast(2))) void f(int x, int y); void g(int x, int y, int z); f(0, 0); @@ -3728,10 +3740,11 @@- Matcher<CallExpr> argumentCountAtLeast unsigned N Checks that a call expression or a constructor call expression has -at least the specified number of arguments (including absent default arguments). + Checks that a call expression or a constructor call expression has at least +the specified number of arguments (including absent default arguments). -Example matches f(0, 0) and g(0, 0, 0) (matcher = callExpr(argumentCountAtLeast(2))) +Example matches f(0, 0) and g(0, 0, 0) +(matcher = callExpr(argumentCountAtLeast(2))) void f(int x, int y); void g(int x, int y, int z); f(0, 0); @@ -4897,10 +4910,11 @@- Matcher<ObjCMessageExpr> argumentCountAtLeast unsigned N Checks that a call expression or a constructor call expression has -at least the specified number of arguments (including absent default arguments). + Checks that a call expression or a constructor call expression has at least +the specified number of arguments (including absent default arguments). -Example matches f(0, 0) and g(0, 0, 0) (matcher = callExpr(argumentCountAtLeast(2))) +Example matches f(0, 0) and g(0, 0, 0) +(matcher = callExpr(argumentCountAtLeast(2))) void f(int x, int y); void g(int x, int y, int z); f(0, 0); @@ -6795,9 +6809,10 @@- Matcher<CXXForRangeStmt> hasBody Matcher<Stmt> InnerMatcher Matches a 'for', 'while', 'do' statement or a function definition that has -a given body. Note that in case of functions this matcher only matches the -definition itself and not the other declarations of the same function. ++ Matches a 'for', 'while', 'while' statement or a function or coroutine +definition that has a given body. Note that in case of functions or +coroutines this matcher only matches the definition itself and not the +other declarations of the same function or coroutine. Given for (;;) {} @@ -7682,6 +7697,30 @@+ Matcher<CoroutineBodyStmt> hasBody Matcher<Stmt> InnerMatcher + + Matches a 'for', 'while', 'while' statement or a function or coroutine +definition that has a given body. Note that in case of functions or +coroutines this matcher only matches the definition itself and not the +other declarations of the same function or coroutine. + +Given + for (;;) {} +forStmt(hasBody(compoundStmt())) + matches 'for (;;) {}' +with compoundStmt() + matching '{}' + +Given + void f(); + void f() {} +functionDecl(hasBody(compoundStmt())) + matches 'void f() {}' +with compoundStmt() + matching '{}' + but does not match 'void f();' +Matcher<DecayedType> hasDecayedType Matcher<QualType> InnerType @@ -7890,9 +7929,10 @@ Matches the decayed type, whoes decayed type matches InnerMatcher- Matcher<DoStmt> hasBody Matcher<Stmt> InnerMatcher Matches a 'for', 'while', 'do' statement or a function definition that has -a given body. Note that in case of functions this matcher only matches the -definition itself and not the other declarations of the same function. + Matches a 'for', 'while', 'while' statement or a function or coroutine +definition that has a given body. Note that in case of functions or +coroutines this matcher only matches the definition itself and not the +other declarations of the same function or coroutine. Given for (;;) {} @@ -8226,9 +8266,10 @@- Matcher<ForStmt> hasBody Matcher<Stmt> InnerMatcher Matches a 'for', 'while', 'do' statement or a function definition that has -a given body. Note that in case of functions this matcher only matches the -definition itself and not the other declarations of the same function. + Matches a 'for', 'while', 'while' statement or a function or coroutine +definition that has a given body. Note that in case of functions or +coroutines this matcher only matches the definition itself and not the +other declarations of the same function or coroutine. Given for (;;) {} @@ -8420,9 +8461,10 @@- Matcher<FunctionDecl> hasBody Matcher<Stmt> InnerMatcher Matches a 'for', 'while', 'do' statement or a function definition that has -a given body. Note that in case of functions this matcher only matches the -definition itself and not the other declarations of the same function. + Matches a 'for', 'while', 'while' statement or a function or coroutine +definition that has a given body. Note that in case of functions or +coroutines this matcher only matches the definition itself and not the +other declarations of the same function or coroutine. Given for (;;) {} @@ -10082,9 +10124,10 @@- Matcher<WhileStmt> hasBody Matcher<Stmt> InnerMatcher Matches a 'for', 'while', 'do' statement or a function definition that has -a given body. Note that in case of functions this matcher only matches the -definition itself and not the other declarations of the same function. + Matches a 'for', 'while', 'while' statement or a function or coroutine +definition that has a given body. Note that in case of functions or +coroutines this matcher only matches the definition itself and not the +other declarations of the same function or coroutine. Given for (;;) {}