summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/UseAfterMoveCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Move a few more checks from misc to bugprone.Alexander Kornienko2017-11-241-434/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: clang_tidy/rename_check.py misc-assert-side-effect bugprone-assert-side-effect clang_tidy/rename_check.py misc-bool-pointer-implicit-conversion bugprone-bool-pointer-implicit-conversion clang_tidy/rename_check.py misc-fold-init-type bugprone-fold-init-type clang_tidy/rename_check.py misc-forward-declaration-namespace bugprone-forward-declaration-namespace clang_tidy/rename_check.py misc-inaccurate-erase bugprone-inaccurate-erase clang_tidy/rename_check.py misc-move-forwarding-reference bugprone-move-forwarding-reference clang_tidy/rename_check.py misc-multiple-statement-macro bugprone-multiple-statement-macro clang_tidy/rename_check.py misc-use-after-move bugprone-use-after-move clang_tidy/rename_check.py misc-virtual-near-miss bugprone-virtual-near-miss Manually fixed a reference to UseAfterMoveCheck in the hicpp module. Manually fixed header guards. Reviewers: hokein Reviewed By: hokein Subscribers: nemanjai, mgorny, javed.absar, xazax.hun, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D40426 llvm-svn: 318950
* Adapt clang-tidy checks to changing semantics of hasDeclaration.Manuel Klimek2017-08-021-9/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D36154 llvm-svn: 309810
* [clang-tidy] misc-use-after-move: Fix failing assertionMartin Bohme2017-03-081-1/+8
| | | | | | | | | | | | | | | | | | | | | | Summary: I've added a test case that (without the fix) triggers the assertion, which happens when a move happens in an implicitly called conversion operator. This patch also fixes nondeterministic behavior in the source code location reported for the move when the move is constained in an init list; this was causing buildbot failures in the previous attempt to submit this patch (see D30569 and rL297004). Reviewers: alexfh Reviewed By: alexfh Subscribers: Eugene.Zelenko, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D30650 llvm-svn: 297272
* Revert "[clang-tidy] misc-use-after-move: Fix failing assertion"Martin Bohme2017-03-061-1/+1
| | | | | | This reverts commit r297004; it was causing buildbots to fail. llvm-svn: 297006
* [clang-tidy] misc-use-after-move: Fix failing assertionMartin Bohme2017-03-061-1/+1
| | | | | | | | | | | | | | | | | Summary: I've added a test case that (without the fix) triggers the assertion, which happens when a move happens in an implicitly called conversion operator. Reviewers: alexfh Reviewed By: alexfh Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D30569 llvm-svn: 297004
* [clang-tidy] refactor ExprSequence out of use-after-move checkMarek Sokolowski2016-12-241-261/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D27700 llvm-svn: 290489
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-081-8/+6
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [clang-tidy] Extend misc-use-after-move to support unique_ptr and shared_ptr.Martin Bohme2016-11-021-17/+55
| | | | | | | | | | | | | | Summary: As a unique_ptr or shared_ptr that has been moved from is guaranteed to be null, we only warn if the pointer is dereferenced. Reviewers: hokein, alexfh, aaron.ballman Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D26041 llvm-svn: 285842
* [clang-tidy] Add additional diagnostic to misc-use-after-moveMartin Bohme2016-10-141-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [clang-tidy] Add check 'misc-use-after-move'Martin Bohme2016-09-141-0/+643
Summary: The check warns if an object is used after it has been moved, without an intervening reinitialization. See user-facing documentation for details. Reviewers: sbenza, Prazek, alexfh Subscribers: beanz, mgorny, shadeware, omtcyfz, Eugene.Zelenko, Prazek, fowles, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D23353 llvm-svn: 281453
OpenPOWER on IntegriCloud