Description
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
Labels
Language frontend issues, e.g. anything involving "Sema"Language frontend issues, e.g. anything involving "Sema"Anything related to constant evaluationAnything related to constant evaluation