Skip to content

Commit

Permalink
[clang] Update C++ DR status page (llvm#121642)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Endilll authored Jan 4, 2025
1 parent 47ac7fa commit da2a9ed
Show file tree
Hide file tree
Showing 5 changed files with 413 additions and 160 deletions.
2 changes: 1 addition & 1 deletion clang/test/CXX/drs/cwg12xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace cwg1213 { // cwg1213: 7
}

#if __cplusplus >= 201103L
namespace cwg1223 { // cwg1223: 17 drafting 2023-05-12
namespace cwg1223 { // cwg1223: 17
struct M;
template <typename T>
struct V;
Expand Down
25 changes: 15 additions & 10 deletions clang/test/CXX/drs/cwg28xx.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// RUN: %clang_cc1 -std=c++98 -pedantic-errors -verify=expected,cxx98 %s
// RUN: %clang_cc1 -std=c++11 -pedantic-errors -verify=expected %s
// RUN: %clang_cc1 -std=c++14 -pedantic-errors -verify=expected %s
// RUN: %clang_cc1 -std=c++17 -pedantic-errors -verify=expected %s
// RUN: %clang_cc1 -std=c++20 -pedantic-errors -verify=expected,since-cxx20 %s
// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected,since-cxx20,since-cxx23 %s
// RUN: %clang_cc1 -std=c++11 -pedantic-errors -verify=expected,cxx11-23 %s
// RUN: %clang_cc1 -std=c++14 -pedantic-errors -verify=expected,cxx11-23 %s
// RUN: %clang_cc1 -std=c++17 -pedantic-errors -verify=expected,cxx11-23 %s
// RUN: %clang_cc1 -std=c++20 -pedantic-errors -verify=expected,cxx11-23,since-cxx20 %s
// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected,cxx11-23,since-cxx20,since-cxx23 %s
// RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected,since-cxx20,since-cxx23,since-cxx26 %s


Expand Down Expand Up @@ -47,12 +47,17 @@ void f() {
#endif
} // namespace cwg2813

namespace cwg2819 { // cwg2819: 19 tentatively ready 2023-12-01

#if __cpp_constexpr >= 202306L
namespace cwg2819 { // cwg2819: 19 c++26
#if __cplusplus >= 201103L
// CWG 2024-04-19: This issue is not a DR.
constexpr void* p = nullptr;
constexpr int* q = static_cast<int*>(p);
static_assert(q == nullptr);
constexpr int* q = static_cast<int*>(p); // #cwg2819-q
// cxx11-23-error@-1 {{constexpr variable 'q' must be initialized by a constant expression}}
// cxx11-23-note@-2 {{cast from 'void *' is not allowed in a constant expression}}
static_assert(q == nullptr, "");
// cxx11-23-error@-1 {{static assertion expression is not an integral constant expression}}
// cxx11-23-note@-2 {{initializer of 'q' is not a constant expression}}
// cxx11-23-note@#cwg2819-q {{declared here}}
#endif
}

Expand Down
6 changes: 3 additions & 3 deletions clang/test/CXX/drs/cwg29xx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// RUN: %clang_cc1 -std=c++23 -pedantic-errors -verify=expected %s
// RUN: %clang_cc1 -std=c++2c -pedantic-errors -verify=expected %s

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

#if __cplusplus >= 202002L

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

} // namespace cwg2913

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


namespace cwg2922 { // cwg2922: 20 tentatively ready 2024-07-10
namespace cwg2922 { // cwg2922: 20
union U { int a, b; };
constexpr U nondeterministic(bool i) {
if(i) {
Expand Down
Loading

0 comments on commit da2a9ed

Please sign in to comment.