summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2016-01-23 17:49:18 +0000
committerAaron Ballman <aaron@aaronballman.com>2016-01-23 17:49:18 +0000
commita681151ebd6fd1a3c561edfad83b1f3118a1ee3f (patch)
treeb0118177acfc401bf1297e6bff00894794bcea9b /clang
parent1235d280d82e5fb0eb7033b4a2eafc8b7b52ceb0 (diff)
downloadbcm5719-llvm-a681151ebd6fd1a3c561edfad83b1f3118a1ee3f.tar.gz
bcm5719-llvm-a681151ebd6fd1a3c561edfad83b1f3118a1ee3f.zip
Improving documentation for the isMoveAssignmentOperator AST matcher.
Patch by Jonathan Coe. llvm-svn: 258628
Diffstat (limited to 'clang')
-rw-r--r--clang/docs/LibASTMatchersReference.html12
-rw-r--r--clang/include/clang/ASTMatchers/ASTMatchers.h12
2 files changed, 14 insertions, 10 deletions
diff --git a/clang/docs/LibASTMatchersReference.html b/clang/docs/LibASTMatchersReference.html
index 2bb6915e92d..75deea40e13 100644
--- a/clang/docs/LibASTMatchersReference.html
+++ b/clang/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 &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>
diff --git a/clang/include/clang/ASTMatchers/ASTMatchers.h b/clang/include/clang/ASTMatchers/ASTMatchers.h
index fda07de7572..c74b4bce9d0 100644
--- a/clang/include/clang/ASTMatchers/ASTMatchers.h
+++ b/clang/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();
}
OpenPOWER on IntegriCloud