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

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 1 10:12:50 PDT 2018


Eugene.Zelenko added inline comments.


================
Comment at: clang-tidy/bugprone/MapSubscriptOperatorLookupCheck.cpp:36
+  if (const auto *Matched = Result.Nodes.getNodeAs<CallExpr>("match")) {
+    diag(Matched->getLocStart(), "do not use operator[] for map lookup")
+        << Matched->getSourceRange();
----------------
Will be good idea to use actual container type.


================
Comment at: docs/ReleaseNotes.rst:63
+
+  FIXME: add release notes.
+
----------------
Please add short description and place with other new checks in alphabetical order.


================
Comment at: docs/clang-tidy/checks/bugprone-map-subscript-operator-lookup.rst:6
+
+FIXME: Describe what patterns does the check detect and why. Give examples.
----------------
Please add description and examples.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D46317





More information about the cfe-commits mailing list