The Infinite Loop Checker could report a false positive on the example below:
void f() { static int i = 0; i++; while (i < 10) f(); }
This patch adds checking for recursive calls in the Infinite Loop Checker when loop condition involves static local variables.
Ok so this whole checker does this procedure involving ExprMutationAnalyzer trying to figure out if the variable can be changed from within the loop. I wonder if our problem of whether the static variable can be changed within the loop is a sub-problem of this problem and therefore could have a general solution inside ExprMutationAnalyzer. If so, other clang-tidy checks that use ExprMutationAnalyzer could immediately benefit from such solution. WDYT?