[PATCH] D18265: [clang-tidy] New: checker misc-unconventional-assign-operator replacing misc-assign-operator-signature

Samuel Benzaquen via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 27 07:46:28 PDT 2016


sbenza accepted this revision.

================
Comment at: clang-tidy/misc/UnconventionalAssignOperatorCheck.cpp:69
@@ +68,3 @@
+void UnconventionalAssignOperatorCheck::check(const MatchFinder::MatchResult &Result) {
+  if (const auto *RetStmt = Result.Nodes.getNodeAs<ReturnStmt>("returnStmt")) {
+    diag(RetStmt->getLocStart(), "operator=() should always return '*this'");
----------------
baloghadamsoftware wrote:
> sbenza wrote:
> > couldn't this be folded into the Messages array below?
> There would be no benefit of it since we use the location of RetStmt in this message instead of Method.
Right. So it can't really be merged. That's fine.


http://reviews.llvm.org/D18265





More information about the cfe-commits mailing list