[PATCH] D44883: [Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 31 09:59:56 PDT 2018


rjmccall added inline comments.


================
Comment at: docs/ReleaseNotes.rst:63
+- ``-Wself-assign`` and ``-Wself-assign-field`` were extended to diagnose
+  self-assignment operations using overloaded operators (i.e. classes)
+
----------------
Missing a final period.  Also, these release notes serve as a kind of user guide, so I would recommend mentioning the suppression contraption here.  Maybe something like "If you are doing such an assignment intentionally, e.g. in a unit test for a data structure, the warning can be suppressed by adding *& to the right-hand side or casting it to the appropriate reference type."


Repository:
  rC Clang

https://reviews.llvm.org/D44883





More information about the cfe-commits mailing list