Correct documentation for the hasBody() AST matcher; NFC
authorAaron Ballman <aaron@aaronballman.com>
Tue, 10 Jan 2023 14:53:19 +0000 (09:53 -0500)
committerAaron Ballman <aaron@aaronballman.com>
Tue, 10 Jan 2023 14:53:19 +0000 (09:53 -0500)
Note, when regenerating the documentation for this change, no changes
were made to the HTML file. There is an existing bug with the AST
matcher python script that fails to handle hasBody() specifically. So
this commit is to correct the internal documentation but another change
will be needed to fix the public documentation.

clang/include/clang/ASTMatchers/ASTMatchers.h

index 5d3d458..2046c59 100644 (file)
@@ -5468,7 +5468,7 @@ AST_MATCHER_P(ArraySubscriptExpr, hasBase,
 /// \code
 ///   for (;;) {}
 /// \endcode
-/// hasBody(compoundStmt())
+/// forStmt(hasBody(compoundStmt()))
 ///   matches 'for (;;) {}'
 /// with compoundStmt()
 ///   matching '{}'
@@ -5478,7 +5478,7 @@ AST_MATCHER_P(ArraySubscriptExpr, hasBase,
 ///   void f();
 ///   void f() {}
 /// \endcode
-/// hasBody(functionDecl())
+/// functionDecl(hasBody(compoundStmt()))
 ///   matches 'void f() {}'
 /// with compoundStmt()
 ///   matching '{}'