[PATCH] D45766: [Sema] Add -Wno-self-assign-overloaded

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 23 13:15:59 PDT 2018


dblaikie accepted this revision.
dblaikie added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/Sema/SemaExpr.cpp:11527-11528
 
-  S.Diag(OpLoc, diag::warn_self_assignment)
-      << LHSDeclRef->getType()
-      << LHSExpr->getSourceRange() << RHSExpr->getSourceRange();
+  S.Diag(OpLoc, IsBuiltin ? diag::warn_self_assignment_builtin
+                          : diag::warn_self_assignment_overloaded)
+      << LHSDeclRef->getType() << LHSExpr->getSourceRange()
----------------
lebedev.ri wrote:
> dblaikie wrote:
> > Presumably this also changes how the warning is enabled? But that doesn't seem to be tested in this patch?
> What testing do you have in mind?
> The `test/SemaCXX/warn-self-assign-overloaded.cpp` change was supposed to show how it is enabled..
ah, misread those - figured they were testing the negative case (given the name of this patch) but I see they're testing the positive case.

Maybe testing the negative case would be useful too?


Repository:
  rC Clang

https://reviews.llvm.org/D45766





More information about the cfe-commits mailing list