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

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 16 03:06:58 PDT 2018


lebedev.ri added a comment.

There are several options:

1. @rjmccall's idea: `-wtest` (lowercase), which in this case will disable that new code in `BuildOverloadedBinOp()`. i quite like it actually.
2. split it up like i had in the first revision - ``-Wself-assign-builtin``, ``-Wself-assign-field-builtin``; ``-Wself-assign-overloaded``, ``-Wself-assign-field-overloaded``
  - we could just assume that `BuildOverloadedBinOp()` implies overloaded,
  - or check that the particular operator is non-trivial
3. ???

@rjmccall, @thakis, @dblaikie, @aaron.ballman, @brooksmoses, @chandlerc

I'm going to go ahead and look into `1.`, since it does not seem there will be any consensus in a timely manner.


Repository:
  rC Clang

https://reviews.llvm.org/D44883





More information about the cfe-commits mailing list