[PATCH] D21134: clang-tidy: new check readability-misplaced-array-index
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 8 08:54:08 PDT 2016
aaron.ballman added inline comments.
Comment at: clang-tidy/readability/MisplacedArrayIndexCheck.cpp:48
@@ +47,3 @@
+ auto D =
> 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.
I'm okay with that approach.
More information about the cfe-commits