From: Aaron Ballman Date: Sat, 23 Jan 2016 17:49:18 +0000 (+0000) Subject: Improving documentation for the isMoveAssignmentOperator AST matcher. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=817e45ed3b6f2dceb326b40146b7cd759786482a;p=clang Improving documentation for the isMoveAssignmentOperator AST matcher. Patch by Jonathan Coe. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258628 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/docs/LibASTMatchersReference.html b/docs/LibASTMatchersReference.html index 2bb6915e92..75deea40e1 100644 --- a/docs/LibASTMatchersReference.html +++ b/docs/LibASTMatchersReference.html @@ -1820,11 +1820,13 @@ matches A and C::f, but not B, C, or B::f operator. Given - struct S { - S(const S &); #1 - S& operator=(S &&); #2 - }; -cxxMethodDecl(isMoveAssignmentOperator()) will match #2, but not #1. +struct A { + A &operator=(const A &); + A &operator=(A &&); +}; + +cxxMethodDecl(isMoveAssignmentOperator()) matches the second method but not +the first one. diff --git a/include/clang/ASTMatchers/ASTMatchers.h b/include/clang/ASTMatchers/ASTMatchers.h index fda07de757..c74b4bce9d 100644 --- a/include/clang/ASTMatchers/ASTMatchers.h +++ b/include/clang/ASTMatchers/ASTMatchers.h @@ -3581,12 +3581,14 @@ AST_MATCHER(CXXMethodDecl, isCopyAssignmentOperator) { /// /// Given /// \code -/// struct S { -/// S(const S &); // #1 -/// S& operator=(S &&); // #2 -/// }; +/// struct A { +/// A &operator=(const A &); +/// A &operator=(A &&); +/// }; /// \endcode -/// cxxMethodDecl(isMoveAssignmentOperator()) will match #2, but not #1. +/// +/// cxxMethodDecl(isMoveAssignmentOperator()) matches the second method but not +/// the first one. AST_MATCHER(CXXMethodDecl, isMoveAssignmentOperator) { return Node.isMoveAssignmentOperator(); }