[PATCH] [clang-tidy] Checker for inaccurate use of erase method.
Gábor Horváth
xazax.hun at gmail.com
Mon Feb 9 01:09:52 PST 2015
Hi alexfh,
Checks for inaccurate use of \c erase() method.
Algorithms like \c remove() does not actually remove any element from the
container but returns an iterator to the first redundant element at the end
of the container. These redundant elements must be removed using the
\c erase() method. This check warns when not all of the elements will be
removed due to using an inappropriate overload.
http://reviews.llvm.org/D7496
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/InaccurateEraseCheck.cpp
clang-tidy/misc/InaccurateEraseCheck.h
clang-tidy/misc/MiscTidyModule.cpp
test/clang-tidy/misc-inaccurate-erase.cpp
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7496.19566.patch
Type: text/x-patch
Size: 7924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150209/401da24f/attachment.bin>
More information about the cfe-commits
mailing list