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

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 14 06:59:36 PDT 2018


lebedev.ri added a comment.

In https://reviews.llvm.org/D45766#1097797, @ksu.shadura wrote:

> Thank you for the test example! I got your point, but I wanted to ask if it should be like this for commutative operations?




> In our case it is actually matrix, and subtraction of matrices is not commutative operation..

With that context, i do agree that it is a false-positive.
Please file a bug (do we already have a 7.0 metabug yet?).

I'm not too sure what is the best way to solve this.
The most obvious solution would be taking the operator status into account,
like it was considered during review, https://reviews.llvm.org/D44883#1048520, 
https://godbolt.org/g/7K7Uwy - and if it is "non_trivial",
then issue it under `-Wself-assign-overloaded-nontrivial` ?


Repository:
  rL LLVM

https://reviews.llvm.org/D45766





More information about the cfe-commits mailing list