Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Clang] Regression on not rejecting UB in constexpr reference initialization due to implementing P2280R4 #131330

Copy link
Copy link
@frederick-vs-ja

Description

@frederick-vs-ja
Issue body actions

Currently, Clang accepts the following code snippet since C++23 mode. Godbolt link.

constexpr int& r = r;

[dcl.ref]/6 (as clarified by the resolution of CWG453) indicates that such reference binding has UB, and thus needs to be rejected in constant evaluation.

Perhaps this is due to something missed in #95474.

Codegen change can be observed by dropping constexpr (Godbolt link), but this is conforming as such initialization raises UB.

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.