<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>></td><td class="name" onclick="toggle('hasBody3')"><a name="hasBody3Anchor">hasBody</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
-<tr><td colspan="4" class="doc" id="hasBody3"><pre></pre></td></tr>
+<tr><td colspan="4" class="doc" id="hasBody3"><pre>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.
+
+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();'
+</pre></td></tr>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1CXXForRangeStmt.html">CXXForRangeStmt</a>></td><td class="name" onclick="toggle('hasInitStatement2')"><a name="hasInitStatement2Anchor">hasInitStatement</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1DoStmt.html">DoStmt</a>></td><td class="name" onclick="toggle('hasBody0')"><a name="hasBody0Anchor">hasBody</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
-<tr><td colspan="4" class="doc" id="hasBody0"><pre></pre></td></tr>
+<tr><td colspan="4" class="doc" id="hasBody0"><pre>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.
+
+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();'
+</pre></td></tr>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1DoStmt.html">DoStmt</a>></td><td class="name" onclick="toggle('hasCondition3')"><a name="hasCondition3Anchor">hasCondition</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1ForStmt.html">ForStmt</a>></td><td class="name" onclick="toggle('hasBody1')"><a name="hasBody1Anchor">hasBody</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
-<tr><td colspan="4" class="doc" id="hasBody1"><pre></pre></td></tr>
+<tr><td colspan="4" class="doc" id="hasBody1"><pre>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.
+
+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();'
+</pre></td></tr>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1ForStmt.html">ForStmt</a>></td><td class="name" onclick="toggle('hasCondition1')"><a name="hasCondition1Anchor">hasCondition</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('hasBody4')"><a name="hasBody4Anchor">hasBody</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
-<tr><td colspan="4" class="doc" id="hasBody4"><pre></pre></td></tr>
+<tr><td colspan="4" class="doc" id="hasBody4"><pre>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.
+
+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();'
+</pre></td></tr>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1FunctionDecl.html">FunctionDecl</a>></td><td class="name" onclick="toggle('hasExplicitSpecifier0')"><a name="hasExplicitSpecifier0Anchor">hasExplicitSpecifier</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1WhileStmt.html">WhileStmt</a>></td><td class="name" onclick="toggle('hasBody2')"><a name="hasBody2Anchor">hasBody</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Stmt.html">Stmt</a>> InnerMatcher</td></tr>
-<tr><td colspan="4" class="doc" id="hasBody2"><pre></pre></td></tr>
+<tr><td colspan="4" class="doc" id="hasBody2"><pre>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.
+
+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();'
+</pre></td></tr>
<tr><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1WhileStmt.html">WhileStmt</a>></td><td class="name" onclick="toggle('hasCondition2')"><a name="hasCondition2Anchor">hasCondition</a></td><td>Matcher<<a href="https://clang.llvm.org/doxygen/classclang_1_1Expr.html">Expr</a>> InnerMatcher</td></tr>
return false;
}
-/// Matches a 'for', 'while', 'do while' 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', '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.
///
/// Given
/// \code
/// with compoundStmt()
/// matching '{}'
/// but does not match 'void f();'
-
AST_POLYMORPHIC_MATCHER_P(hasBody,
AST_POLYMORPHIC_SUPPORTED_TYPES(DoStmt, ForStmt,
WhileStmt,