Skip to content

[clang] Accepts-invalid (?) in discarded statement with return type deduction #151242

@efriedma-quic

Description

@efriedma-quic

Consider:

auto f() { if constexpr (false) return; return 3; } 

Missing error on the first return statement.

I think this violates [stmt.return]p2? Or maybe it's an oversight in the wording.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepts-invalidclang:frontendLanguage frontend issues, e.g. anything involving "Sema"constexprAnything related to constant evaluation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions