[PATCH] D53974: [clang-tidy] new check: bugprone-too-small-loop-variable

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 6 00:56:12 PST 2018

JonasToth added inline comments.

Comment at: clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp:20
+static const char LoopName[] = "forLoopName";
+static const char loopVarName[] = "loopVar";
JonasToth wrote:
> ztamas wrote:
> > JonasToth wrote:
> > > Please move these variable in the matcher function and make them `StringRef` instead of `const char[]`.
> > These variables are used not only inside the matcher function but also in the check() function.
> > 
> I didn't see that, but they should still be `StringRef` as type.
One more nit i forgot: these variables should be `static` for linkage and be CamelCase to match the naming conventions.

  rCTE Clang Tools Extra


More information about the cfe-commits mailing list