Issue 56035
Summary -Winfinite-recursion confused by some tautological expressions
Labels clang:frontend, clang:diagnostics
Assignees
Reporter AaronBallman
    Consider code like:
```
void func1(int i) {
  if (i || !i)
    func1(i);
}

void func2(int i) {
  if (i > 0 || i <= 0)
    func2(i);
}
```
Clang correctly diagnoses `func2()` as being recursive along all paths, but it mysteriously does not diagnose `func1()`. (https://godbolt.org/z/Ks3Wvdf8W)

Surprisingly, we don't seem to catch `i || !i` as being a tautological comparison, so it's possible that's a related issue (https://godbolt.org/z/hs9Ehrbss).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to