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

Finding infinite loops is well-known to be impossible (halting problem).
However, it is possible to detect some obvious infinite loops, for example,
if the loop condition is not changed. Detecting such loops is beneficial
since the tests will hang on programs containing infinite loops so
testing-time detection may be costly in large systems. Obvious cases are
where the programmer forgets to increment/decrement the counter or
increments/decrements the wrong variable.

Differential Revision: https://reviews.llvm.org/D64736



git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@372693 91177308-0d34-0410-b5e6-96231b3b80d8
4 files changed