[clang] f30257e - Correct documentation for the hasBody() AST matcher; NFC

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 10 06:54:55 PST 2023


Author: Aaron Ballman
Date: 2023-01-10T09:53:19-05:00
New Revision: f30257ea9f34b36597067554a45a266dc914b5a7

URL: https://github.com/llvm/llvm-project/commit/f30257ea9f34b36597067554a45a266dc914b5a7
DIFF: https://github.com/llvm/llvm-project/commit/f30257ea9f34b36597067554a45a266dc914b5a7.diff

LOG: Correct documentation for the hasBody() AST matcher; NFC

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.

Added: 
    

Modified: 
    clang/include/clang/ASTMatchers/ASTMatchers.h

Removed: 
    


################################################################################
diff  --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index 5d3d458b6409..2046c59de287 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -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 '{}'


        


More information about the cfe-commits mailing list