Skip to content

Commit da2a9ed

Browse files
authored
[clang] Update C++ DR status page (llvm#121642)
This patch brings our C++ DR status page up to date with WG21 updates. [CWG1223](https://cplusplus.github.io/CWG/issues/1223.html) "Syntactic disambiguation and _trailing-return-types_" is resolved by [P2915R0](https://wg21.link/p2915r0) "Proposed resolution for CWG1223". Both the test and the paper were written by @cor3ntin, so I presume no updates are needed. [CWG2819](https://cplusplus.github.io/CWG/issues/2819.html) "Cast from null pointer value in a constant expression" was revisited and marked as not a DR, so I updated the test to ensure that the example is not accepted in C++23 and earlier modes. CC @offsetof. Tentantive resolutions to the following issues were simply promoted to actual resolutions, so tests don't require any meaningful changes: - [CWG2913](https://cplusplus.github.io/CWG/issues/2913.html) "Grammar for deduction-guide has requires-clause in the wrong position" (@zyn0217) - [CWG2915](https://cplusplus.github.io/CWG/issues/2915.html) "Explicit object parameters of type void" (@MitalAshok) - [CWG2922](https://cplusplus.github.io/CWG/issues/2922.html) "constexpr placement-new is too permissive" (@cor3ntin) As a drive-by fix, I updated the `make_cxx_dr_status` script to accommodate for `C++23 onwards` and `C++26 onwards` statuses, which are useful for Core issues that are not DRs.
1 parent 47ac7fa commit da2a9ed

File tree

5 files changed

+413
-160
lines changed

5 files changed

+413
-160
lines changed

clang/test/CXX/drs/cwg12xx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace cwg1213 { // cwg1213: 7
3232
}
3333

3434
#if __cplusplus >= 201103L
35-
namespace cwg1223 { // cwg1223: 17 drafting 2023-05-12
35+
namespace cwg1223 { // cwg1223: 17
3636
struct M;
3737
template <typename T>
3838
struct V;

clang/test/CXX/drs/cwg28xx.cpp

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// RUN: %clang_cc1 -std=c++98 -pedantic-errors -verify=expected,cxx98 %s
2-
// RUN: %clang_cc1 -std=c++11 -pedantic-errors -verify=expected %s
3-
// RUN: %clang_cc1 -std=c++14 -pedantic-errors -verify=expected %s
4-
// RUN: %clang_cc1 -std=c++17 -pedantic-errors -verify=expected %s
5-
// RUN: %clang_cc1 -std=c++20 -pedantic-errors -verify=expected,since-cxx20 %s
6-
// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected,since-cxx20,since-cxx23 %s
2+
// RUN: %clang_cc1 -std=c++11 -pedantic-errors -verify=expected,cxx11-23 %s
3+
// RUN: %clang_cc1 -std=c++14 -pedantic-errors -verify=expected,cxx11-23 %s
4+
// RUN: %clang_cc1 -std=c++17 -pedantic-errors -verify=expected,cxx11-23 %s
5+
// RUN: %clang_cc1 -std=c++20 -pedantic-errors -verify=expected,cxx11-23,since-cxx20 %s
6+
// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected,cxx11-23,since-cxx20,since-cxx23 %s
77
// RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected,since-cxx20,since-cxx23,since-cxx26 %s
88

99

@@ -47,12 +47,17 @@ void f() {
4747
#endif
4848
} // namespace cwg2813
4949

50-
namespace cwg2819 { // cwg2819: 19 tentatively ready 2023-12-01
51-
52-
#if __cpp_constexpr >= 202306L
50+
namespace cwg2819 { // cwg2819: 19 c++26
51+
#if __cplusplus >= 201103L
52+
// CWG 2024-04-19: This issue is not a DR.
5353
constexpr void* p = nullptr;
54-
constexpr int* q = static_cast<int*>(p);
55-
static_assert(q == nullptr);
54+
constexpr int* q = static_cast<int*>(p); // #cwg2819-q
55+
// cxx11-23-error@-1 {{constexpr variable 'q' must be initialized by a constant expression}}
56+
// cxx11-23-note@-2 {{cast from 'void *' is not allowed in a constant expression}}
57+
static_assert(q == nullptr, "");
58+
// cxx11-23-error@-1 {{static assertion expression is not an integral constant expression}}
59+
// cxx11-23-note@-2 {{initializer of 'q' is not a constant expression}}
60+
// cxx11-23-note@#cwg2819-q {{declared here}}
5661
#endif
5762
}
5863

clang/test/CXX/drs/cwg29xx.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected %s
77
// RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected %s
88

9-
namespace cwg2913 { // cwg2913: 20 tentatively ready 2024-08-16
9+
namespace cwg2913 { // cwg2913: 20
1010

1111
#if __cplusplus >= 202002L
1212

@@ -26,7 +26,7 @@ R(T, T) requires true -> R<T>; // expected-error {{expected function body after
2626

2727
} // namespace cwg2913
2828

29-
namespace cwg2915 { // cwg2915: 20 tentatively ready 2024-08-16
29+
namespace cwg2915 { // cwg2915: 20
3030
#if __cplusplus >= 202302L
3131
struct A {
3232
void f(this void); // expected-error {{explicit object parameter cannot have 'void' type}}
@@ -61,7 +61,7 @@ void *operator new(std::size_t, void *p) { return p; }
6161
void* operator new[] (std::size_t, void* p) {return p;}
6262

6363

64-
namespace cwg2922 { // cwg2922: 20 tentatively ready 2024-07-10
64+
namespace cwg2922 { // cwg2922: 20
6565
union U { int a, b; };
6666
constexpr U nondeterministic(bool i) {
6767
if(i) {

0 commit comments

Comments
 (0)