[PATCH] D33844: [clang-tidy] terminating continue check

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 22 08:38:37 PDT 2018


JonasToth added a comment.

I think this check could land in the `bugprone` module.

Given this situation won't appear a lot in codebases, did you check other codebases than LLVM?



================
Comment at: clang-tidy/misc/TerminatingContinueCheck.h:19
+
+/// Checks if a 'continue' statement terminates the loop. It does if the loop
+/// has false condition.
----------------
I think you can make one sentence out of both.


================
Comment at: docs/clang-tidy/checks/misc-terminating-continue.rst:6
+
+Detects `do while` loops with `false` conditions that have `continue` statement
+as this `continue` terminates the loop effectively.
----------------
Maybe rephrase a little:

`loops with a condition always evaluating to false` or something like it.


================
Comment at: docs/clang-tidy/checks/misc-terminating-continue.rst:21
+        ConsumeToken();
+        continue;
+      }
----------------
Please emphasize this location, so that it is absolutly clear what you mean.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D33844





More information about the cfe-commits mailing list