]> granicus.if.org Git - clang/commitdiff
Improving documentation for the isMoveAssignmentOperator AST matcher.
authorAaron Ballman <aaron@aaronballman.com>
Sat, 23 Jan 2016 17:49:18 +0000 (17:49 +0000)
committerAaron Ballman <aaron@aaronballman.com>
Sat, 23 Jan 2016 17:49:18 +0000 (17:49 +0000)
Patch by Jonathan Coe.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258628 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 2bb6915e92dce5fd74cd0a9c5f690c25845fb4e4..75deea40e13498cdba7ddfb0871ca533c7e4a888 100644 (file)
@@ -1820,11 +1820,13 @@ matches A and C::f, but not B, C, or B::f
 operator.
 
 Given
-  struct S {
-    S(const S &amp;); #1
-    S&amp; operator=(S &amp;&amp;); #2
-  };
-cxxMethodDecl(isMoveAssignmentOperator()) will match #2, but not #1.
+struct A {
+  A &amp;operator=(const A &amp;);
+  A &amp;operator=(A &amp;&amp;);
+};
+
+cxxMethodDecl(isMoveAssignmentOperator()) matches the second method but not
+the first one.
 </pre></td></tr>
 
 
index fda07de75720aae9105c4b6a03f1e12f08ccf241..c74b4bce9d07e12a5b3e5d352fab9e5fd1e73547 100644 (file)
@@ -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();
 }