lebedev.ri added inline comments.
================ Comment at: clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp:20 + +static const char LoopName[] = "forLoopName"; +static const char loopVarName[] = "loopVar"; ---------------- Szelethus wrote: > JonasToth wrote: > > 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. > Hmmm, `StringRef` actually has a `constexpr` constructor, we could make these > `constexpr` too I guess. You want `StringLiteral`: ``` static constexpr llvm::StringLiteral loopVarCastName = llvm::StringLiteral("loopVarCast"); static constexpr llvm::StringLiteral loopCondName = llvm::StringLiteral("loopCond"); static constexpr llvm::StringLiteral loopIncrementName = llvm::StringLiteral("loopIncrement"); ``` Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53974 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits