incorrect -Winfinite-recursion warning on potentially-unevaluated operand · Issue #21668 · llvm/llvm-project (original) (raw)

Bugzilla Link 21294
Version trunk
OS Linux
CC @Weverything

Extended Description

This:

#include
int f() {
typeid(f());
return 0;
}

gives:

:2:9: warning: all paths through this function will call itself [-Winfinite-recursion]
int f() {
^

... which is not true, because in this case the operand of typeid(...) is unevaluated.