ztamas added inline comments.

================
Comment at: clang-tidy/bugprone/TooSmallLoopVariableCheck.cpp:142
+  if (LoopVar->getType() != LoopIncrement->getType())
+    return; // We matched the loop variable incorrectly
+
----------------
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.


================
Comment at: docs/clang-tidy/checks/bugprone-too-small-loop-variable.rst:10
+
+  .. code-block:: c++
+
----------------
JonasToth wrote:
> the `.. code-block:: c++` is usually not indended, only the code itself.
Hmm, I copied this from somewhere. It might be a good idea to make this 
consistent across all the *.rst files. See bugprone-suspicious-semicolon.rst or 
bugprone-use-after-move.rst for example.


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

Reply via email to