Author: Nathan James Date: 2021-03-15T13:06:49Z New Revision: 6badd3c52dc8a9c0a253a48722c569beeeefea4f
URL: https://github.com/llvm/llvm-project/commit/6badd3c52dc8a9c0a253a48722c569beeeefea4f DIFF: https://github.com/llvm/llvm-project/commit/6badd3c52dc8a9c0a253a48722c569beeeefea4f.diff LOG: [ASTMatchers] Fix documentation for hasAnyBody matcher Looks like a oversight when the matcher was added. Reviewed By: steveire Differential Revision: https://reviews.llvm.org/D98583 Added: Modified: clang/docs/LibASTMatchersReference.html clang/include/clang/ASTMatchers/ASTMatchers.h Removed: ################################################################################ diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html index 0becf5ebfb8c..0d2570bcd58f 100644 --- a/clang/docs/LibASTMatchersReference.html +++ b/clang/docs/LibASTMatchersReference.html @@ -7509,7 +7509,7 @@ <h2 id="traversal-matchers">AST Traversal Matchers</h2> void f(); void f() {} void g(); -hasAnyBody(functionDecl()) +functionDecl(hasAnyBody(compoundStmt())) matches both 'void f();' and 'void f() {}' with compoundStmt() diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h index 885bc74ad3ea..64e8cecf4822 100644 --- a/clang/include/clang/ASTMatchers/ASTMatchers.h +++ b/clang/include/clang/ASTMatchers/ASTMatchers.h @@ -5217,7 +5217,7 @@ AST_POLYMORPHIC_MATCHER_P(hasBody, /// void f() {} /// void g(); /// \endcode -/// hasAnyBody(functionDecl()) +/// functionDecl(hasAnyBody(compoundStmt())) /// matches both 'void f();' /// and 'void f() {}' /// with compoundStmt() _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits