[clang-tidy] Add clang-tidy check for unique_ptr's reset+release -> move
authorAlexander Kornienko <alexfh@google.com>
Fri, 5 Dec 2014 11:59:05 +0000 (11:59 +0000)
committerAlexander Kornienko <alexfh@google.com>
Fri, 5 Dec 2014 11:59:05 +0000 (11:59 +0000)
commitbc0c423a46adde261cee400a74a84311c84ce287
tree7655d49a58e5a1e25e741b3120443458d3d2a622
parent31f6c54733031ce9f6a05444d0ef10eec481d729
[clang-tidy] Add clang-tidy check for unique_ptr's reset+release -> move

Replace x.reset(y.release()); with x = std::move(y);
If y is rvalue, replace with x = y; instead.

http://reviews.llvm.org/D6485

Patch by Alexey Sokolov!

llvm-svn: 223460
clang-tools-extra/clang-tidy/misc/CMakeLists.txt
clang-tools-extra/clang-tidy/misc/MiscTidyModule.cpp
clang-tools-extra/clang-tidy/misc/UniqueptrResetRelease.cpp [new file with mode: 0644]
clang-tools-extra/clang-tidy/misc/UniqueptrResetRelease.h [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/misc-uniqueptr-reset-release.cpp [new file with mode: 0644]