Skip to content

tautological warnings for is_constant_evaluated not emitted in c++23/26 modes #125955

@cor3ntin

Description

@cor3ntin

for

int main() {
   if constexpr(std::is_constant_evaluated()) { }
}

We usually warn

'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression [-Wconstant-evaluated]

However this warning is gone in c++23 mode

https://godbolt.org/z/KKPKvveGM

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:frontendLanguage frontend issues, e.g. anything involving "Sema"confirmedVerified by a second partyconstexprAnything related to constant evaluation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions