[ASTMatchers] Fix documentation for hasAnyBody matcher
authorNathan James <n.james93@hotmail.co.uk>
Mon, 15 Mar 2021 13:06:48 +0000 (13:06 +0000)
committerNathan James <n.james93@hotmail.co.uk>
Mon, 15 Mar 2021 13:06:49 +0000 (13:06 +0000)
Looks like a oversight when the matcher was added.

Reviewed By: steveire

Differential Revision: https://reviews.llvm.org/D98583

clang/docs/LibASTMatchersReference.html
clang/include/clang/ASTMatchers/ASTMatchers.h

index 0becf5e..0d2570b 100644 (file)
@@ -7509,7 +7509,7 @@ Given
   void f();
   void f() {}
   void g();
-hasAnyBody(functionDecl())
+functionDecl(hasAnyBody(compoundStmt()))
   matches both 'void f();'
   and 'void f() {}'
 with compoundStmt()
index 885bc74..64e8cec 100644 (file)
@@ -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()