diff options
author | Martin Bohme <mboehme@google.com> | 2016-10-14 13:23:39 +0000 |
---|---|---|
committer | Martin Bohme <mboehme@google.com> | 2016-10-14 13:23:39 +0000 |
commit | 934743f8f8dbd291b7288aa7cb5ad9ae0960ef3b (patch) | |
tree | be52efb71e8a4dfe256b2e6002854c2c08ce418d /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 270173f2dbbbefae1e4e457d407d8d637ee7ff2e (diff) | |
download | bcm5719-llvm-934743f8f8dbd291b7288aa7cb5ad9ae0960ef3b.tar.gz bcm5719-llvm-934743f8f8dbd291b7288aa7cb5ad9ae0960ef3b.zip |
[clang-tidy] Add additional diagnostic to misc-use-after-move
Summary:
This adds a diagnostic to the misc-use-after-move check that is output when the
use happens on a later loop iteration than the move, for example:
A a;
for (int i = 0; i < 10; ++i) {
a.foo();
std::move(a);
}
This situation can be confusing to users because, in terms of source code
location, the use is above the move. This can make it look as if the warning
is a false positive, particularly if the loop is long but the use and move are
close together.
In cases like these, misc-use-after-move will now output an additional
diagnostic:
a.cpp:393:7: note: the use happens in a later loop iteration than the move
Reviewers: hokein
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D25612
llvm-svn: 284235
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
0 files changed, 0 insertions, 0 deletions