<div dir="ltr">Thanks! Could you do the same for the other files changed in that revision?<br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 31, 2015 at 4:23 PM, Aaron Ballman via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: aaronballman<br>
Date: Mon Aug 31 09:23:21 2015<br>
New Revision: 246444<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=246444&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=246444&view=rev</a><br>
Log:<br>
Using an early return as it is more clear; NFC.<br>
<br>
Modified:<br>
clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.cpp<br>
<br>
Modified: clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.cpp?rev=246444&r1=246443&r2=246444&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.cpp?rev=246444&r1=246443&r2=246444&view=diff</a><br>
==============================================================================<br>
--- clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.cpp (original)<br>
+++ clang-tools-extra/trunk/clang-tidy/misc/AssignOperatorSignatureCheck.cpp Mon Aug 31 09:23:21 2015<br>
@@ -21,35 +21,35 @@ void AssignOperatorSignatureCheck::regis<br>
ast_matchers::MatchFinder *Finder) {<br>
// Only register the matchers for C++; the functionality currently does not<br>
// provide any benefit to other languages, despite being benign.<br>
- if (getLangOpts().CPlusPlus) {<br>
- const auto HasGoodReturnType = methodDecl(returns(lValueReferenceType(<br>
- pointee(unless(isConstQualified()),<br>
- hasDeclaration(equalsBoundNode("class"))))));<br>
-<br>
- const auto IsSelf = qualType(anyOf(<br>
- hasDeclaration(equalsBoundNode("class")),<br>
- referenceType(pointee(hasDeclaration(equalsBoundNode("class"))))));<br>
- const auto IsSelfAssign =<br>
- methodDecl(unless(anyOf(isDeleted(), isPrivate(), isImplicit())),<br>
- hasName("operator="), ofClass(recordDecl().bind("class")),<br>
- hasParameter(0, parmVarDecl(hasType(IsSelf))))<br>
- .bind("method");<br>
-<br>
- Finder->addMatcher(<br>
- methodDecl(IsSelfAssign, unless(HasGoodReturnType)).bind("ReturnType"),<br>
- this);<br>
-<br>
- const auto BadSelf = referenceType(<br>
- anyOf(lValueReferenceType(pointee(unless(isConstQualified()))),<br>
- rValueReferenceType(pointee(isConstQualified()))));<br>
-<br>
- Finder->addMatcher(<br>
- methodDecl(IsSelfAssign, hasParameter(0, parmVarDecl(hasType(BadSelf))))<br>
- .bind("ArgumentType"),<br>
- this);<br>
+ if (!getLangOpts().CPlusPlus)<br>
+ return;<br>
<br>
- Finder->addMatcher(methodDecl(IsSelfAssign, isConst()).bind("Const"), this);<br>
- }<br>
+ const auto HasGoodReturnType = methodDecl(returns(lValueReferenceType(pointee(<br>
+ unless(isConstQualified()), hasDeclaration(equalsBoundNode("class"))))));<br>
+<br>
+ const auto IsSelf = qualType(<br>
+ anyOf(hasDeclaration(equalsBoundNode("class")),<br>
+ referenceType(pointee(hasDeclaration(equalsBoundNode("class"))))));<br>
+ const auto IsSelfAssign =<br>
+ methodDecl(unless(anyOf(isDeleted(), isPrivate(), isImplicit())),<br>
+ hasName("operator="), ofClass(recordDecl().bind("class")),<br>
+ hasParameter(0, parmVarDecl(hasType(IsSelf))))<br>
+ .bind("method");<br>
+<br>
+ Finder->addMatcher(<br>
+ methodDecl(IsSelfAssign, unless(HasGoodReturnType)).bind("ReturnType"),<br>
+ this);<br>
+<br>
+ const auto BadSelf = referenceType(<br>
+ anyOf(lValueReferenceType(pointee(unless(isConstQualified()))),<br>
+ rValueReferenceType(pointee(isConstQualified()))));<br>
+<br>
+ Finder->addMatcher(<br>
+ methodDecl(IsSelfAssign, hasParameter(0, parmVarDecl(hasType(BadSelf))))<br>
+ .bind("ArgumentType"),<br>
+ this);<br>
+<br>
+ Finder->addMatcher(methodDecl(IsSelfAssign, isConst()).bind("Const"), this);<br>
}<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br>
</div></div>