Issue |
131330
|
Summary |
[Clang] Regression on not rejecting UB in constexpr reference initialization due to implementing P2280R4
|
Labels |
clang:frontend,
accepts-invalid,
constexpr
|
Assignees |
|
Reporter |
frederick-vs-ja
|
Currently, Clang accepts the following code snippet since C++23 mode. [Godbolt link](https://godbolt.org/z/5cxGrq6Gb).
```C++
constexpr int& r = r;
```
[[dcl.ref]/6](https://eel.is/c++draft/dcl.ref#6) (as clarified by the resolution of [CWG453](https://cplusplus.github.io/CWG/issues/453.html)) 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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs