summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2018-04-07 10:39:21 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2018-04-07 10:39:21 +0000
commit61061d69eacfb546283f33cba053c29bb1c1ef7e (patch)
tree671a06ad0b749490526e6b057db7c7d772d57d90 /llvm/lib/Target
parent41922f1a6d153e4754bde2ef3a3662d578dfdc69 (diff)
downloadbcm5719-llvm-61061d69eacfb546283f33cba053c29bb1c1ef7e.tar.gz
bcm5719-llvm-61061d69eacfb546283f33cba053c29bb1c1ef7e.zip
[Sema] Extend -Wself-assign and -Wself-assign-field to warn on overloaded self-assignment (classes)
Summary: This has just bit me, so i though it would be nice to avoid that next time :) Motivational case: https://godbolt.org/g/cq9UNk Basically, it's likely to happen if you don't like shadowing issues, and use `-Wshadow` and friends. And it won't be diagnosed by clang. The reason is, these self-assign diagnostics only work for builtin assignment operators. Which makes sense, one could have a very special operator=, that does something unusual in case of self-assignment, so it may make sense to not warn on that. But while it may be intentional in some cases, it may be a bug in other cases, so it would be really great to have some diagnostic about it... Reviewers: aaron.ballman, rsmith, rtrieu, nikola, rjmccall, dblaikie Reviewed By: rjmccall Subscribers: EricWF, lebedev.ri, thakis, Quuxplusone, cfe-commits Differential Revision: https://reviews.llvm.org/D44883 llvm-svn: 329493
Diffstat (limited to 'llvm/lib/Target')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud