Skip to content

[clang][docs] Reflect the implementation status for P2280R4 #127166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clang/test/SemaCXX/constant-expression-cxx11.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2005,7 +2005,7 @@ namespace ConstexprConstructorRecovery {
constexpr X x{}; // cxx11-error {{constant expression}} cxx11-note {{not initialized}}
}

namespace Lifetime {
namespace Lifetime { // FIXME: Fix the error messages quality regression introduced by GH95474.
void f() {
constexpr int &n = n; // expected-error {{constant expression}} cxx23-note {{reference to 'n' is not a constant expression}} cxx23-note {{address of non-static constexpr variable 'n' may differ}} expected-warning {{not yet bound to a value}}
// cxx11_20-note@-1 {{use of reference outside its lifetime is not allowed in a constant expression}}
Expand Down Expand Up @@ -2421,7 +2421,7 @@ namespace PR41854 {
unsigned b = d.c;
}

namespace array_size {
namespace array_size { // FIXME: P2280R4 should be backported, and these cases should be accepted in C++11 and later.
template<int N> struct array {
static constexpr int size() { return N; }
};
Expand Down
2 changes: 2 additions & 0 deletions clang/test/SemaCXX/constant-expression-p2280r4.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// RUN: %clang_cc1 -std=c++23 -verify=expected,nointerpreter %s
// RUN: %clang_cc1 -std=c++23 -verify %s -fexperimental-new-constant-interpreter

// FIXME: P2280R4 should be backported. Run this in C++11 and later modes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On top of this FIXME, add RUN lines for C++11 mode, then add expected directives for whatever comes out of it. So that if someone accidentally makes it work, it doesn't go unnoticed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should instead do that in #129646 (and merge that first)


using size_t = decltype(sizeof(0));

namespace std {
Expand Down
7 changes: 6 additions & 1 deletion clang/www/cxx_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ <h2 id="cxx23">C++23 implementation status</h2>
<tr>
<td>Using unknown pointers and references in constant expressions</td>
<td><a href="https://wg21.link/P2280R4">P2280R4</a> (<a href="#dr">DR</a>)</td>
<td class="full" align="center">Clang 20</td>
<td class="full" align="center">Clang 20 <a href="#p2280">(12)</a></td>
</tr>
<tr>
<td>static <code>operator()</code></td>
Expand Down Expand Up @@ -546,6 +546,11 @@ <h2 id="cxx23">C++23 implementation status</h2>
<td class="full" align="center">Yes</td>
</tr>
</table>

<p>
<span id="p2280">(12): This feature is not yet available in C++20 and earlier modes.
</span>
</p>
</details>


Expand Down