[PATCH] D46317: [clang-tidy] New check bugprone-map-subscript-operator-lookup

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 2 10:55:25 PDT 2018


aaron.ballman added a comment.

I am generally in favor of this but would be curious to see how the check reacts to real world code bases. Facebook's usage experience is compelling, but I'm also wondering how bad the false-positive rate is on existing code. Can you try running the check over LLVM itself (perhaps after adding the option to add custom data types to the list and adding DenseMap and friends) and report back on what you find?



================
Comment at: clang-tidy/bugprone/MapSubscriptOperatorLookupCheck.cpp:21
+void MapSubscriptOperatorLookupCheck::registerMatchers(MatchFinder *Finder) {
+  Finder->addMatcher(
+      cxxOperatorCallExpr(
----------------
No need to register the matchers unless in C++ mode.


================
Comment at: clang-tidy/bugprone/MapSubscriptOperatorLookupCheck.h:19
+
+/// FIXME: Write a short description.
+///
----------------
Should fix up the description.


================
Comment at: docs/clang-tidy/checks/list.rst:96
    fuchsia-default-arguments
+   fuchsia-header-anon-namespaces (redirects to google-build-namespaces) <fuchsia-header-anon-namespaces>
    fuchsia-multiple-inheritance
----------------
This change looks unrelated (but reasonable -- you can commit this change without review).


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D46317





More information about the cfe-commits mailing list