ztamas added inline comments.
================ Comment at: clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp:142 + if (LoopVar->getType() != LoopIncrement->getType()) + return; // We matched the loop variable incorrectly + ---------------- ztamas wrote: > JonasToth wrote: > > Does this try to ensure a precondition? Then it should become an assertion > > instead. > > Please adjust the comment like above (punctuation, position) > It's not an assumed precondition. This `if` handles the case when > LoopVarMatcher is not fitted with the actual loop variable. That's why the > IncrementMatcher is there so we can check whether we found the loop variable. > See voidForLoopReverseCond() test case which hits this `if` branch. > I did not find a solution to handle this check inside the matcher. voidForLoopReverseCond() was renamed to voidForLoopCondImplicitCast() in the mean time. 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