[PATCH] D98583: [ASTMatchers] Fix documentation for hasAnyBody matcher
Nathan James via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Mar 13 09:13:21 PST 2021
njames93 created this revision.
njames93 added reviewers: baloghadamsoftware, aaron.ballman.
Herald added a subscriber: rnkovacs.
njames93 requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Looks like a oversight when the matcher was added.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D98583
Files:
clang/docs/LibASTMatchersReference.html
clang/include/clang/ASTMatchers/ASTMatchers.h
Index: clang/include/clang/ASTMatchers/ASTMatchers.h
===================================================================
--- clang/include/clang/ASTMatchers/ASTMatchers.h
+++ clang/include/clang/ASTMatchers/ASTMatchers.h
@@ -5217,7 +5217,7 @@
/// void f() {}
/// void g();
/// \endcode
-/// hasAnyBody(functionDecl())
+/// functionDecl(hasAnyBody(compoundStmt()))
/// matches both 'void f();'
/// and 'void f() {}'
/// with compoundStmt()
Index: clang/docs/LibASTMatchersReference.html
===================================================================
--- clang/docs/LibASTMatchersReference.html
+++ clang/docs/LibASTMatchersReference.html
@@ -7509,7 +7509,7 @@
void f();
void f() {}
void g();
-hasAnyBody(functionDecl())
+functionDecl(hasAnyBody(compoundStmt()))
matches both 'void f();'
and 'void f() {}'
with compoundStmt()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98583.330455.patch
Type: text/x-patch
Size: 859 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210313/59986147/attachment.bin>
More information about the cfe-commits
mailing list