[PATCH] D21134: clang-tidy: new check readability-misplaced-array-index

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 8 08:51:18 PDT 2016

alexfh added inline comments.

Comment at: clang-tidy/readability/MisplacedArrayIndexCheck.cpp:48
@@ +47,3 @@
+  auto D =
+      diag(ArraySubscriptE->getLocStart(),
aaron.ballman wrote:
> Should not use `auto` here because the type is not spelled out in the initialization.
While in general I agree with this recommendation, `auto Diag = diag(...);` has almost become an idiom in this code. I'd not worry about obscurity of `auto` in this context, especially, if the variable is renamed to `Diag`, which will make its meaning and possible ways of using it clearer.


More information about the cfe-commits mailing list