Skip to content

incorrect -Winfinite-recursion warning on potentially-unevaluated operand #21668

@zygoloid

Description

@zygoloid
mannequin
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.

Metadata

Metadata

Assignees

Labels

bugzillaIssues migrated from bugzillaclang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerconfirmedVerified by a second partygood first issuehttps://github.com/llvm/llvm-project/contribute

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions