summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/misc-use-after-move.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Move a few more checks from misc to bugprone.Alexander Kornienko2017-11-241-1164/+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
* [clang-tidy] Added clang-tidy test cases related to rL310095Florian Gross2017-08-041-0/+5
| | | | | | Differential Revision: https://reviews.llvm.org/D36308 llvm-svn: 310096
* [clang-tidy] Add a test for PR33020Alexander Kornienko2017-05-121-0/+20
| | | | | | Fix committed in clang as r302889. llvm-svn: 302890
* [clang-tidy] misc-use-after-move: Fix failing assertionMartin Bohme2017-03-081-1/+16
| | | | | | | | | | | | | | | | | | | | | | 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-16/+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/+16
| | | | | | | | | | | | | | | | | 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] Extend misc-use-after-move to support unique_ptr and shared_ptr.Martin Bohme2016-11-021-5/+88
| | | | | | | | | | | | | | 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-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] Make test for misc-use-after-move pass under WindowsMartin Bohme2016-09-141-1/+1
| | | | | | | | | | | | Summary: Adds -fno-delayed-template-parsing Reviewers: alexfh Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24550 llvm-svn: 281455
* [clang-tidy] Add check 'misc-use-after-move'Martin Bohme2016-09-141-0/+1039
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