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

Matthias Gehre via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Apr 17 02:07:54 PDT 2020


mgehre added inline comments.


================
Comment at: test/clang-tidy/bugprone-map-subscript-operator-lookup.cpp:60
+}
+
+void noWarning() {
----------------
We often have code like
```
auto &V = Map[Idx];
if (!V) {
  V = init();
}
use(V);
```
Would that be flagged by this check? Could you add a test for it (possibly with `FIXME`)?


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D46317/new/

https://reviews.llvm.org/D46317





More information about the cfe-commits mailing list