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()
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()
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits