[PATCH] Add clang-tidy check for unique_ptr's reset+release→move
Alexey Sokolov
sokolov at google.com
Tue Dec 2 11:51:06 PST 2014
Hi alexfh,
Replace `x.reset(y.release());` with `x = std::move(y);`
If y is rvalue, replace with `x = y;` instead
http://reviews.llvm.org/D6485
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/UniqueptrResetRelease.cpp
clang-tidy/misc/UniqueptrResetRelease.h
test/clang-tidy/uniqueptr-reset-release.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6485.16825.patch
Type: text/x-patch
Size: 7650 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141202/df91ef98/attachment.bin>
More information about the cfe-commits
mailing list