[PATCH] D64736: [clang-tidy] New bugprone-infinite-loop check for detecting obvious infinite loops

Eugene Zelenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 15 06:52:49 PDT 2019


Eugene.Zelenko added inline comments.


================
Comment at: clang-tidy/bugprone/InfiniteLoopCheck.cpp:164
+
+  std::string Result = "";
+  for (const Stmt *Child : Cond->children()) {
----------------
Unnecessary initialization. See readability-redundant-string-init.


================
Comment at: docs/ReleaseNotes.rst:114
 
+- New :doc:`bugprone-infinite-loop
+  <clang-tidy/checks/bugprone-infinite-loop>` check.
----------------
Wrong entry.


================
Comment at: docs/ReleaseNotes.rst:238
 
+- New :doc:`bugprone-infinite-loop <clang-tidy/checks/bugprone-infinite-loop>`
+  check to detect obvious infinite loops (loops where the condition variable is
----------------
Please move into new checks list (in alphabetical order)


================
Comment at: docs/ReleaseNotes.rst:239
+- New :doc:`bugprone-infinite-loop <clang-tidy/checks/bugprone-infinite-loop>`
+  check to detect obvious infinite loops (loops where the condition variable is
+  not changed at all).
----------------
Please separate with empty line and use first statement from documentation here.


================
Comment at: docs/clang-tidy/checks/bugprone-infinite-loop.rst:13
+detects such loops. A loop is considered as infinite if it does not have any
+loop exit statement (`break`, `continue`, `goto`, `return`, `throw`) and all of
+the following conditions hold for every variable in the condition:
----------------
Please use double back-ticks to highlight language constructs. Same below.


Repository:
  rCTE Clang Tools Extra

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64736/new/

https://reviews.llvm.org/D64736





More information about the cfe-commits mailing list