[PATCH] D46317: [clang-tidy] New check bugprone-map-subscript-operator-lookup
Kalle Huttunen via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri May 8 11:48:16 PDT 2020
khuttun added a comment.
In D46317#2027071 <https://reviews.llvm.org/D46317#2027071>, @aaron.ballman wrote:
> In D46317#2023406 <https://reviews.llvm.org/D46317#2023406>, @khuttun wrote:
>
> > Any comments on this? Is this checker something that could be part of clang-tidy?
>
>
> Thank you for posting some of the diagnostics found by the check, that was really helpful information! I spot-checked ~10 of the issues it reported and all of them were false positives. Were you able to find any true positives from that list? I think 1200 reports without any true positives indicates that the check may be too chatty to include (it may also suggest that `bugprone` is the wrong place for the check).
It's difficult to spot actual functionality bugs without knowing the code better, but there's plenty of unnecessary double-lookups (count()/find() + operator[]) reported, for example:
clang-tools-extra/clang-reorder-fields/ReorderFieldsAction.cpp:75:30
clang-tools-extra/clang-tidy/bugprone/ForwardDeclarationNamespaceCheck.cpp:157:33
clang-tools-extra/clang-tidy/modernize/DeprecatedHeadersCheck.cpp:106:29
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D46317/new/
https://reviews.llvm.org/D46317
More information about the cfe-commits
mailing list