[PATCH] D45685: [Sema] Add -wtest global flag that silences -Wself-assign for overloaded operators.

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 16 11:18:20 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D45685#1068981, @Quuxplusone wrote:

> I don't understand the spelling of this option. You spell it `-wtest` (because rjmccall suggested that spelling); but for my money it should be spelled `-Wno-self-assign-nonfield`.


You did read the documentation change, right?

> Also, if you go this route, you miss the true positive reported by someone on the other patch, where the self-assignment involved a local variable named `color`.

Uhm, why? `-wtest` is not the default, so the warning would still have been issued there.

> Sorry I can't find the example right now. You'd have to trawl through all the patches opened on this subject in the past couple of weeks.




Repository:
  rC Clang

https://reviews.llvm.org/D45685





More information about the cfe-commits mailing list