[clang] [clang] Do less advertising for unresolved issues in `cxx_dr_status.html` (PR #78836)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 15 07:40:08 PST 2024


https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/78836

>From c931f87fdabe83e1e3507f0e52ebb3201a41cb82 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: Sat, 20 Jan 2024 12:04:32 +0300
Subject: [PATCH 1/5] [clang] Stop reporting unresolved issues in
 `cxx_dr_status.html`

This patch prevents tests for unresolved issues to report availability (e.g. `no` or `18`) on `cxx_dr_status.html` page. But it still checks whether specified status matches status on the official list, preventing tests going out of date.

Because of aforementioned points, availability comment syntax is now simpler for tests for unresolved issues. What was previously written as `// dr2345: 18 drafting` is now simply `// dr2345: drafting`.

This has been discussed in a PR for CWG472 test: https://github.com/llvm/llvm-project/pull/67948#discussion_r1452506341
---
 clang/test/CXX/drs/dr12xx.cpp |  2 +-
 clang/test/CXX/drs/dr18xx.cpp |  2 +-
 clang/test/CXX/drs/dr20xx.cpp |  2 +-
 clang/test/CXX/drs/dr2335.cpp |  2 +-
 clang/test/CXX/drs/dr23xx.cpp |  2 +-
 clang/test/CXX/drs/dr24xx.cpp |  4 +--
 clang/test/CXX/drs/dr25xx.cpp |  8 +++---
 clang/www/cxx_dr_status.html  | 22 ++++++++---------
 clang/www/make_cxx_dr_status  | 46 ++++++++++++++++-------------------
 9 files changed, 43 insertions(+), 47 deletions(-)

diff --git a/clang/test/CXX/drs/dr12xx.cpp b/clang/test/CXX/drs/dr12xx.cpp
index cb4cc5aef17371..aaedbe916dc213 100644
--- a/clang/test/CXX/drs/dr12xx.cpp
+++ b/clang/test/CXX/drs/dr12xx.cpp
@@ -32,7 +32,7 @@ namespace dr1213 { // dr1213: 7
 }
 
 #if __cplusplus >= 201103L
-namespace dr1223 { // dr1223: 17 drafting
+namespace dr1223 { // dr1223: drafting
 struct M;
 template <typename T>
 struct V;
diff --git a/clang/test/CXX/drs/dr18xx.cpp b/clang/test/CXX/drs/dr18xx.cpp
index 0245f03986dd73..f6c94f32506cb2 100644
--- a/clang/test/CXX/drs/dr18xx.cpp
+++ b/clang/test/CXX/drs/dr18xx.cpp
@@ -331,7 +331,7 @@ namespace dr1881 { // dr1881: 7
   static_assert(!__is_standard_layout(D), "");
 }
 
-namespace dr1890 { // dr1890: no drafting
+namespace dr1890 { // dr1890: drafting
 // FIXME: current consensus for CWG2335 is that the examples are well-formed.
 namespace ex1 {
 #if __cplusplus >= 201402L
diff --git a/clang/test/CXX/drs/dr20xx.cpp b/clang/test/CXX/drs/dr20xx.cpp
index f7f37379e61ad1..016ba4e2ccb85d 100644
--- a/clang/test/CXX/drs/dr20xx.cpp
+++ b/clang/test/CXX/drs/dr20xx.cpp
@@ -90,7 +90,7 @@ namespace dr2026 { // dr2026: 11
   }
 }
 
-namespace dr2049 { // dr2049: 18 drafting
+namespace dr2049 { // dr2049: drafting
 #if __cplusplus >= 202302L
 template <int* x = {}> struct X {};
 X<> a;
diff --git a/clang/test/CXX/drs/dr2335.cpp b/clang/test/CXX/drs/dr2335.cpp
index d143aaf7cb0ac0..ac0193db06bdb7 100644
--- a/clang/test/CXX/drs/dr2335.cpp
+++ b/clang/test/CXX/drs/dr2335.cpp
@@ -10,7 +10,7 @@
 // expected-no-diagnostics
 #endif
 
-namespace dr2335 { // dr2335: no drafting
+namespace dr2335 { // dr2335: drafting
 // FIXME: current consensus is that the examples are well-formed.
 #if __cplusplus >= 201402L
 namespace ex1 {
diff --git a/clang/test/CXX/drs/dr23xx.cpp b/clang/test/CXX/drs/dr23xx.cpp
index d8556998315c77..0f87904c860b61 100644
--- a/clang/test/CXX/drs/dr23xx.cpp
+++ b/clang/test/CXX/drs/dr23xx.cpp
@@ -57,7 +57,7 @@ void g() {
 } //namespace dr2303
 #endif
 
-namespace dr2311 {  // dr2311: 18 open
+namespace dr2311 {  // dr2311: open
 #if __cplusplus >= 201707L
 template<typename T>
 void test() {
diff --git a/clang/test/CXX/drs/dr24xx.cpp b/clang/test/CXX/drs/dr24xx.cpp
index 66e9cf5a677f80..a4d40fa96b66f4 100644
--- a/clang/test/CXX/drs/dr24xx.cpp
+++ b/clang/test/CXX/drs/dr24xx.cpp
@@ -45,7 +45,7 @@ void fallthrough(int n) {
 #endif
 }
 
-namespace dr2450 { // dr2450: 18 review
+namespace dr2450 { // dr2450: review
 #if __cplusplus >= 202302L
 struct S {int a;};
 template <S s>
@@ -59,7 +59,7 @@ f<{.a= 0}>();
 #endif
 }
 
-namespace dr2459 { // dr2459: 18 drafting
+namespace dr2459 { // dr2459: drafting
 #if __cplusplus >= 202302L
 struct A {
   constexpr A(float) {}
diff --git a/clang/test/CXX/drs/dr25xx.cpp b/clang/test/CXX/drs/dr25xx.cpp
index 502f03271d9afe..b28abc4166e3a0 100644
--- a/clang/test/CXX/drs/dr25xx.cpp
+++ b/clang/test/CXX/drs/dr25xx.cpp
@@ -83,7 +83,7 @@ using ::dr2521::operator""_div;
 
 
 #if __cplusplus >= 202302L
-namespace dr2553 { // dr2553: 18 review
+namespace dr2553 { // dr2553: review
 struct B {
   virtual void f(this B&); 
   // since-cxx23-error at -1 {{an explicit object parameter cannot appear in a virtual function}}
@@ -101,7 +101,7 @@ struct D : B {
 #endif
 
 #if __cplusplus >= 202302L
-namespace dr2554 { // dr2554: 18 review
+namespace dr2554 { // dr2554: review
 struct B {
   virtual void f(); // #dr2554-g
 };
@@ -128,7 +128,7 @@ struct D3 : B {
 #endif
 
 #if __cplusplus >= 202302L
-namespace dr2561 { // dr2561: 18 review
+namespace dr2561 { // dr2561: review
 struct C {
     constexpr C(auto) { }
 };
@@ -143,7 +143,7 @@ void foo() {
 #endif
 
 
-namespace dr2565 { // dr2565: 16 open
+namespace dr2565 { // dr2565: open
 #if __cplusplus >= 202002L
   template<typename T>
     concept C = requires (typename T::type x) {
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index b29a746bcf6e8a..d58ca825d8af70 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -7146,7 +7146,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/1223.html">1223</a></td>
     <td>drafting</td>
     <td>Syntactic disambiguation and <I>trailing-return-type</I>s</td>
-    <td class="full" align="center">Clang 17</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr id="1224">
     <td><a href="https://cplusplus.github.io/CWG/issues/1224.html">1224</a></td>
@@ -11148,7 +11148,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/1890.html">1890</a></td>
     <td>drafting</td>
     <td>Member type depending on definition of member function</td>
-    <td class="none" align="center">No</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr id="1891">
     <td><a href="https://cplusplus.github.io/CWG/issues/1891.html">1891</a></td>
@@ -12102,7 +12102,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2049.html">2049</a></td>
     <td>drafting</td>
     <td>List initializer in non-type template default argument</td>
-    <td class="unreleased" align="center">Clang 18</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr id="2050">
     <td><a href="https://cplusplus.github.io/CWG/issues/2050.html">2050</a></td>
@@ -13674,7 +13674,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2311.html">2311</a></td>
     <td>open</td>
     <td>Missed case for guaranteed copy elision</td>
-    <td class="unreleased" align="center">Clang 18</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr id="2312">
     <td><a href="https://cplusplus.github.io/CWG/issues/2312.html">2312</a></td>
@@ -13818,7 +13818,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2335.html">2335</a></td>
     <td>drafting</td>
     <td>Deduced return types vs member types</td>
-    <td class="none" align="center">No</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr id="2336">
     <td><a href="https://cplusplus.github.io/CWG/issues/2336.html">2336</a></td>
@@ -14508,7 +14508,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2450.html">2450</a></td>
     <td>review</td>
     <td><I>braced-init-list</I> as a <I>template-argument</I></td>
-    <td class="unreleased" align="center">Clang 18</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr id="2451">
     <td><a href="https://cplusplus.github.io/CWG/issues/2451.html">2451</a></td>
@@ -14562,7 +14562,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2459.html">2459</a></td>
     <td>drafting</td>
     <td>Template parameter initialization</td>
-    <td class="unreleased" align="center">Clang 18</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr id="2460">
     <td><a href="https://cplusplus.github.io/CWG/issues/2460.html">2460</a></td>
@@ -15126,13 +15126,13 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2553.html">2553</a></td>
     <td>review</td>
     <td>Restrictions on explicit object member functions</td>
-    <td class="unreleased" align="center">Clang 18</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr class="open" id="2554">
     <td><a href="https://cplusplus.github.io/CWG/issues/2554.html">2554</a></td>
     <td>review</td>
     <td>Overriding virtual functions, also with explicit object parameters</td>
-    <td class="unreleased" align="center">Clang 18</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr class="open" id="2555">
     <td><a href="https://cplusplus.github.io/CWG/issues/2555.html">2555</a></td>
@@ -15174,7 +15174,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2561.html">2561</a></td>
     <td>review</td>
     <td>Conversion to function pointer for lambda with explicit object parameter</td>
-    <td class="unreleased" align="center">Clang 18</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr class="open" id="2562">
     <td><a href="https://cplusplus.github.io/CWG/issues/2562.html">2562</a></td>
@@ -15198,7 +15198,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2565.html">2565</a></td>
     <td>open</td>
     <td>Invalid types in the <I>parameter-declaration-clause</I> of a <I>requires-expression</I></td>
-    <td class="full" align="center">Clang 16</td>
+    <td align="center">Not resolved</td>
   </tr>
   <tr class="open" id="2566">
     <td><a href="https://cplusplus.github.io/CWG/issues/2566.html">2566</a></td>
diff --git a/clang/www/make_cxx_dr_status b/clang/www/make_cxx_dr_status
index b0898ac25b7220..09858473ce7d83 100755
--- a/clang/www/make_cxx_dr_status
+++ b/clang/www/make_cxx_dr_status
@@ -132,17 +132,6 @@ latest_release = 17
 def availability(issue):
   status = status_map.get(issue, 'unknown')
 
-  unresolved_status = ''
-  if status.endswith(' open'):
-    status = status[:-5]
-    unresolved_status = 'open'
-  elif status.endswith(' drafting'):
-    status = status[:-9]
-    unresolved_status = 'drafting'
-  elif status.endswith(' review'):
-    status = status[:-7]
-    unresolved_status = 'review'
-
   avail_suffix = ''
   if status.endswith(' c++11'):
     status = status[:-6]
@@ -191,17 +180,26 @@ def availability(issue):
     else:
       avail = 'Superseded by <a href="#%s">%s</a>' % (dup, dup)
       try:
-        _, avail_style, _ = availability(int(dup))
+        _, avail_style = availability(int(dup))
       except:
         print("issue %s marked as sup %s" % (issue, dup), file=sys.stderr)
         avail_style = ' class="none"'
   elif status.startswith('dup '):
     dup = int(status.split(' ', 1)[1])
     avail = 'Duplicate of <a href="#%s">%s</a>' % (dup, dup)
-    _, avail_style, _ = availability(dup)
+    _, avail_style = availability(dup)
+  elif status == 'open':
+    avail = 'open'
+    avail_style = ''
+  elif status == 'drafting':
+    avail = 'drafting'
+    avail_style = ''
+  elif status == 'review':
+    avail = 'review'
+    avail_style = ''
   else:
     assert False, 'unknown status %s for issue %s' % (status, dr.issue)
-  return (avail + avail_suffix, avail_style, unresolved_status)
+  return (avail + avail_suffix, avail_style)
 
 count = {}
 for dr in drs:
@@ -217,20 +215,18 @@ for dr in drs:
 
   elif dr.status in ('open', 'drafting', 'review'):
     row_style = ' class="open"'
-    avail, avail_style, unresolved_status = availability(dr.issue)
-    if avail == 'Unknown':
-      avail = 'Not resolved'
-      avail_style = ''
-    else:
-      assert unresolved_status == dr.status, \
-             "Issue %s is marked '%s', which differs from CWG index status '%s'" \
-             % (dr.issue, unresolved_status, dr.status)
+    avail, _ = availability(dr.issue)
+    assert avail == 'Unknown' or avail == dr.status, \
+           "Issue %s is marked '%s', which differs from CWG index status '%s'" \
+           % (dr.issue, avail, dr.status)
+    avail = 'Not resolved'
+    avail_style = ''
   else:
     row_style = ''
-    avail, avail_style, unresolved_status = availability(dr.issue)
-    assert not unresolved_status, \
+    avail, avail_style = availability(dr.issue)
+    assert avail not in ('open', 'drafting', 'review'), \
            "Issue %s is marked '%s', even though it is resolved in CWG index" \
-           % (dr.issue, unresolved_status)
+           % (dr.issue, avail)
 
   if not avail.startswith('Sup') and not avail.startswith('Dup'):
     count[avail] = count.get(avail, 0) + 1

>From 5a2caa9eb13721d2d22af124ff83a9a8678caf78 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: Fri, 9 Feb 2024 14:31:17 +0300
Subject: [PATCH 2/5] Add ability to specify what is tested for open issues

Also enable the script to issue more than one error about bad status.
---
 clang/test/CXX/drs/dr12xx.cpp |   2 +-
 clang/test/CXX/drs/dr18xx.cpp |   2 +-
 clang/test/CXX/drs/dr20xx.cpp |   2 +-
 clang/test/CXX/drs/dr2335.cpp |   2 +-
 clang/test/CXX/drs/dr23xx.cpp |   2 +-
 clang/test/CXX/drs/dr24xx.cpp |   4 +-
 clang/test/CXX/drs/dr25xx.cpp |   8 +--
 clang/www/cxx_dr_status.html  |  22 +++----
 clang/www/make_cxx_dr_status  | 115 +++++++++++++++++++++++-----------
 9 files changed, 102 insertions(+), 57 deletions(-)

diff --git a/clang/test/CXX/drs/dr12xx.cpp b/clang/test/CXX/drs/dr12xx.cpp
index aaedbe916dc213..da5dd02a00677c 100644
--- a/clang/test/CXX/drs/dr12xx.cpp
+++ b/clang/test/CXX/drs/dr12xx.cpp
@@ -32,7 +32,7 @@ namespace dr1213 { // dr1213: 7
 }
 
 #if __cplusplus >= 201103L
-namespace dr1223 { // dr1223: drafting
+namespace dr1223 { // dr1223: 17 drafting 2023-05-12
 struct M;
 template <typename T>
 struct V;
diff --git a/clang/test/CXX/drs/dr18xx.cpp b/clang/test/CXX/drs/dr18xx.cpp
index f6c94f32506cb2..e1926110f8de02 100644
--- a/clang/test/CXX/drs/dr18xx.cpp
+++ b/clang/test/CXX/drs/dr18xx.cpp
@@ -331,7 +331,7 @@ namespace dr1881 { // dr1881: 7
   static_assert(!__is_standard_layout(D), "");
 }
 
-namespace dr1890 { // dr1890: drafting
+namespace dr1890 { // dr1890: no drafting 2018-06-04
 // FIXME: current consensus for CWG2335 is that the examples are well-formed.
 namespace ex1 {
 #if __cplusplus >= 201402L
diff --git a/clang/test/CXX/drs/dr20xx.cpp b/clang/test/CXX/drs/dr20xx.cpp
index 016ba4e2ccb85d..96f2572cfb524d 100644
--- a/clang/test/CXX/drs/dr20xx.cpp
+++ b/clang/test/CXX/drs/dr20xx.cpp
@@ -90,7 +90,7 @@ namespace dr2026 { // dr2026: 11
   }
 }
 
-namespace dr2049 { // dr2049: drafting
+namespace dr2049 { // dr2049: 18 drafting P2308R1
 #if __cplusplus >= 202302L
 template <int* x = {}> struct X {};
 X<> a;
diff --git a/clang/test/CXX/drs/dr2335.cpp b/clang/test/CXX/drs/dr2335.cpp
index ac0193db06bdb7..40c82f264db7c9 100644
--- a/clang/test/CXX/drs/dr2335.cpp
+++ b/clang/test/CXX/drs/dr2335.cpp
@@ -10,7 +10,7 @@
 // expected-no-diagnostics
 #endif
 
-namespace dr2335 { // dr2335: drafting
+namespace dr2335 { // dr2335: no drafting 2018-06-04
 // FIXME: current consensus is that the examples are well-formed.
 #if __cplusplus >= 201402L
 namespace ex1 {
diff --git a/clang/test/CXX/drs/dr23xx.cpp b/clang/test/CXX/drs/dr23xx.cpp
index 0f87904c860b61..0d14de52dc0774 100644
--- a/clang/test/CXX/drs/dr23xx.cpp
+++ b/clang/test/CXX/drs/dr23xx.cpp
@@ -57,7 +57,7 @@ void g() {
 } //namespace dr2303
 #endif
 
-namespace dr2311 {  // dr2311: open
+namespace dr2311 {  // dr2311: 18 open 0000-00-00
 #if __cplusplus >= 201707L
 template<typename T>
 void test() {
diff --git a/clang/test/CXX/drs/dr24xx.cpp b/clang/test/CXX/drs/dr24xx.cpp
index a4d40fa96b66f4..ae8dda3351f48e 100644
--- a/clang/test/CXX/drs/dr24xx.cpp
+++ b/clang/test/CXX/drs/dr24xx.cpp
@@ -45,7 +45,7 @@ void fallthrough(int n) {
 #endif
 }
 
-namespace dr2450 { // dr2450: review
+namespace dr2450 { // dr2450: 18 review P2308R1
 #if __cplusplus >= 202302L
 struct S {int a;};
 template <S s>
@@ -59,7 +59,7 @@ f<{.a= 0}>();
 #endif
 }
 
-namespace dr2459 { // dr2459: drafting
+namespace dr2459 { // dr2459: 18 drafting P2308R1
 #if __cplusplus >= 202302L
 struct A {
   constexpr A(float) {}
diff --git a/clang/test/CXX/drs/dr25xx.cpp b/clang/test/CXX/drs/dr25xx.cpp
index b28abc4166e3a0..29e01dcdc82a66 100644
--- a/clang/test/CXX/drs/dr25xx.cpp
+++ b/clang/test/CXX/drs/dr25xx.cpp
@@ -83,7 +83,7 @@ using ::dr2521::operator""_div;
 
 
 #if __cplusplus >= 202302L
-namespace dr2553 { // dr2553: review
+namespace dr2553 { // dr2553: 18 review 2023-07-14
 struct B {
   virtual void f(this B&); 
   // since-cxx23-error at -1 {{an explicit object parameter cannot appear in a virtual function}}
@@ -101,7 +101,7 @@ struct D : B {
 #endif
 
 #if __cplusplus >= 202302L
-namespace dr2554 { // dr2554: review
+namespace dr2554 { // dr2554: 18 review 2021-12-10
 struct B {
   virtual void f(); // #dr2554-g
 };
@@ -128,7 +128,7 @@ struct D3 : B {
 #endif
 
 #if __cplusplus >= 202302L
-namespace dr2561 { // dr2561: review
+namespace dr2561 { // dr2561: 18 review 2023-11-09
 struct C {
     constexpr C(auto) { }
 };
@@ -143,7 +143,7 @@ void foo() {
 #endif
 
 
-namespace dr2565 { // dr2565: open
+namespace dr2565 { // dr2565: 16 open 2023-06-07
 #if __cplusplus >= 202002L
   template<typename T>
     concept C = requires (typename T::type x) {
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index d58ca825d8af70..0a28043b52a8e6 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -7146,7 +7146,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/1223.html">1223</a></td>
     <td>drafting</td>
     <td>Syntactic disambiguation and <I>trailing-return-type</I>s</td>
-    <td align="center">Not resolved</td>
+    <td title="Clang 17.0 implements 2023-05-12 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="1224">
     <td><a href="https://cplusplus.github.io/CWG/issues/1224.html">1224</a></td>
@@ -11148,7 +11148,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/1890.html">1890</a></td>
     <td>drafting</td>
     <td>Member type depending on definition of member function</td>
-    <td align="center">Not resolved</td>
+    <td title="Clang does not implement 2018-06-04 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="1891">
     <td><a href="https://cplusplus.github.io/CWG/issues/1891.html">1891</a></td>
@@ -12102,7 +12102,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2049.html">2049</a></td>
     <td>drafting</td>
     <td>List initializer in non-type template default argument</td>
-    <td align="center">Not resolved</td>
+    <td title="Clang 18.0 implements P2308R1 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="2050">
     <td><a href="https://cplusplus.github.io/CWG/issues/2050.html">2050</a></td>
@@ -13674,7 +13674,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2311.html">2311</a></td>
     <td>open</td>
     <td>Missed case for guaranteed copy elision</td>
-    <td align="center">Not resolved</td>
+    <td title="Clang 18.0 implements 0000-00-00 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="2312">
     <td><a href="https://cplusplus.github.io/CWG/issues/2312.html">2312</a></td>
@@ -13818,7 +13818,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2335.html">2335</a></td>
     <td>drafting</td>
     <td>Deduced return types vs member types</td>
-    <td align="center">Not resolved</td>
+    <td title="Clang does not implement 2018-06-04 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="2336">
     <td><a href="https://cplusplus.github.io/CWG/issues/2336.html">2336</a></td>
@@ -14508,7 +14508,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2450.html">2450</a></td>
     <td>review</td>
     <td><I>braced-init-list</I> as a <I>template-argument</I></td>
-    <td align="center">Not resolved</td>
+    <td title="Clang 18.0 implements P2308R1 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="2451">
     <td><a href="https://cplusplus.github.io/CWG/issues/2451.html">2451</a></td>
@@ -14562,7 +14562,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2459.html">2459</a></td>
     <td>drafting</td>
     <td>Template parameter initialization</td>
-    <td align="center">Not resolved</td>
+    <td title="Clang 18.0 implements P2308R1 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="2460">
     <td><a href="https://cplusplus.github.io/CWG/issues/2460.html">2460</a></td>
@@ -15126,13 +15126,13 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2553.html">2553</a></td>
     <td>review</td>
     <td>Restrictions on explicit object member functions</td>
-    <td align="center">Not resolved</td>
+    <td title="Clang 18.0 implements 2023-07-14 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr class="open" id="2554">
     <td><a href="https://cplusplus.github.io/CWG/issues/2554.html">2554</a></td>
     <td>review</td>
     <td>Overriding virtual functions, also with explicit object parameters</td>
-    <td align="center">Not resolved</td>
+    <td title="Clang 18.0 implements 2021-12-10 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr class="open" id="2555">
     <td><a href="https://cplusplus.github.io/CWG/issues/2555.html">2555</a></td>
@@ -15174,7 +15174,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2561.html">2561</a></td>
     <td>review</td>
     <td>Conversion to function pointer for lambda with explicit object parameter</td>
-    <td align="center">Not resolved</td>
+    <td title="Clang 18.0 implements 2023-11-09 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr class="open" id="2562">
     <td><a href="https://cplusplus.github.io/CWG/issues/2562.html">2562</a></td>
@@ -15198,7 +15198,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2565.html">2565</a></td>
     <td>open</td>
     <td>Invalid types in the <I>parameter-declaration-clause</I> of a <I>requires-expression</I></td>
-    <td align="center">Not resolved</td>
+    <td title="Clang 16.0 implements 2023-06-07 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr class="open" id="2566">
     <td><a href="https://cplusplus.github.io/CWG/issues/2566.html">2566</a></td>
diff --git a/clang/www/make_cxx_dr_status b/clang/www/make_cxx_dr_status
index 09858473ce7d83..019355e6e1a6b5 100755
--- a/clang/www/make_cxx_dr_status
+++ b/clang/www/make_cxx_dr_status
@@ -129,9 +129,26 @@ out_file.write('''\
 
 latest_release = 17
 
+class AvailabilityError(RuntimeError):
+  pass
+
+availability_error_occurred = False
+
 def availability(issue):
   status = status_map.get(issue, 'unknown')
 
+  unresolved_status = ''
+  proposed_resolution = ''
+  unresolved_status_match = re.search(r' (open|drafting|review)', status)
+  if unresolved_status_match:
+    unresolved_status = unresolved_status_match.group(1)
+    proposed_resolution_match = re.search(r' (open|drafting|review) (\d{4}-\d{2}-\d{2}|P\d{4}R\d+)', status)
+    if proposed_resolution_match is None:
+      raise AvailabilityError('Issue {}: \'{}\' status should be followed by a paper number (P1234R5) or proposed resolution in YYYY-MM-DD format'.format(dr.issue, unresolved_status))
+    proposed_resolution = proposed_resolution_match.group(2)
+    status = status[:-1-len(proposed_resolution)]
+    status = status[:-1-len(unresolved_status)]
+
   avail_suffix = ''
   if status.endswith(' c++11'):
     status = status[:-6]
@@ -148,21 +165,37 @@ def availability(issue):
   if status == 'unknown':
     avail = 'Unknown'
     avail_style = ' class="unknown"'
-  elif re.match('^[0-9]+\.?[0-9]*', status):
-    avail = 'Clang %s' % status
-    if float(status) > latest_release:
-      avail_style = ' class="unreleased"'
-    else:
-      avail_style = ' class="full"'
+  elif re.match(r'^[0-9]+\.?[0-9]*', status):
+    if not proposed_resolution:
+      avail = 'Clang %s' % status
+      if float(status) > latest_release:
+        avail_style = ' class="unreleased"'
+      else:
+        avail_style = ' class="full"'
+    else: 
+      avail = 'Not Resolved*'
+      avail_style = f' title="Clang {float(status)} implements {proposed_resolution} resolution"'
   elif status == 'yes':
-    avail = 'Yes'
-    avail_style = ' class="full"'
+    if not proposed_resolution:
+      avail = 'Yes'
+      avail_style = ' class="full"'
+    else:
+      avail = 'Not Resolved*'
+      avail_style = f' title="Clang implements {proposed_resolution} resolution"'
   elif status == 'partial':
-    avail = 'Partial'
-    avail_style = ' class="partial"'
+    if not proposed_resolution:
+      avail = 'Partial'
+      avail_style = ' class="partial"'
+    else:
+      avail = 'Not Resolved*'
+      avail_style = f' title="Clang partially implements {proposed_resolution} resolution"'
   elif status == 'no':
-    avail = 'No'
-    avail_style = ' class="none"'
+    if not proposed_resolution:
+      avail = 'No'
+      avail_style = ' class="none"'
+    else:
+      avail = 'Not Resolved*'
+      avail_style = f' title="Clang does not implement {proposed_resolution} resolution"'
   elif status == 'na':
     avail = 'N/A'
     avail_style = ' class="na"'
@@ -180,26 +213,17 @@ def availability(issue):
     else:
       avail = 'Superseded by <a href="#%s">%s</a>' % (dup, dup)
       try:
-        _, avail_style = availability(int(dup))
+        _, avail_style, _ = availability(int(dup))
       except:
         print("issue %s marked as sup %s" % (issue, dup), file=sys.stderr)
         avail_style = ' class="none"'
   elif status.startswith('dup '):
     dup = int(status.split(' ', 1)[1])
     avail = 'Duplicate of <a href="#%s">%s</a>' % (dup, dup)
-    _, avail_style = availability(dup)
-  elif status == 'open':
-    avail = 'open'
-    avail_style = ''
-  elif status == 'drafting':
-    avail = 'drafting'
-    avail_style = ''
-  elif status == 'review':
-    avail = 'review'
-    avail_style = ''
+    _, avail_style, _ = availability(dup)
   else:
-    assert False, 'unknown status %s for issue %s' % (status, dr.issue)
-  return (avail + avail_suffix, avail_style)
+    raise AvailabilityError('Unknown status %s for issue %s' % (status, dr.issue))
+  return (avail + avail_suffix, avail_style, unresolved_status)
 
 count = {}
 for dr in drs:
@@ -215,18 +239,36 @@ for dr in drs:
 
   elif dr.status in ('open', 'drafting', 'review'):
     row_style = ' class="open"'
-    avail, _ = availability(dr.issue)
-    assert avail == 'Unknown' or avail == dr.status, \
-           "Issue %s is marked '%s', which differs from CWG index status '%s'" \
-           % (dr.issue, avail, dr.status)
-    avail = 'Not resolved'
-    avail_style = ''
+    try:
+      avail, avail_style, unresolved_status = availability(dr.issue)
+    except AvailabilityError as e:
+      availability_error_occurred = True
+      print(e.args[0])
+      continue
+      
+    if avail == 'Unknown':
+      avail = 'Not resolved'
+      avail_style = ''
+    else:
+      if unresolved_status != dr.status:
+        availability_error_occurred = True
+        print("Issue %s is marked '%s', which differs from CWG index status '%s'" \
+             % (dr.issue, unresolved_status, dr.status))
+        continue
   else:
     row_style = ''
-    avail, avail_style = availability(dr.issue)
-    assert avail not in ('open', 'drafting', 'review'), \
-           "Issue %s is marked '%s', even though it is resolved in CWG index" \
-           % (dr.issue, avail)
+    try:
+      avail, avail_style, unresolved_status = availability(dr.issue)
+    except AvailabilityError as e:
+      availability_error_occurred = True
+      print(e.args[0])
+      continue
+
+    if unresolved_status:
+      availability_error_occurred = True
+      print("Issue %s is marked '%s', even though it is resolved in CWG index" \
+           % (dr.issue, unresolved_status))
+      continue
 
   if not avail.startswith('Sup') and not avail.startswith('Dup'):
     count[avail] = count.get(avail, 0) + 1
@@ -239,6 +281,9 @@ for dr in drs:
     <td%s align="center">%s</td>
   </tr>''' % (row_style, dr.issue, dr.issue, dr.issue, dr.status, dr.title, avail_style, avail))
 
+if availability_error_occurred:
+  exit(1)
+
 for status, num in sorted(count.items()):
   print("%s: %s" % (status, num), file=sys.stderr)
 

>From 309745253c43074d2a223e0c42f176113b2f4d95 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: Fri, 9 Feb 2024 14:41:41 +0300
Subject: [PATCH 3/5] Allow date without exact day

---
 clang/test/CXX/drs/dr2335.cpp | 2 +-
 clang/test/CXX/drs/dr4xx.cpp  | 2 +-
 clang/www/cxx_dr_status.html  | 4 ++--
 clang/www/make_cxx_dr_status  | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/clang/test/CXX/drs/dr2335.cpp b/clang/test/CXX/drs/dr2335.cpp
index 40c82f264db7c9..33eebb2c4a5c57 100644
--- a/clang/test/CXX/drs/dr2335.cpp
+++ b/clang/test/CXX/drs/dr2335.cpp
@@ -10,7 +10,7 @@
 // expected-no-diagnostics
 #endif
 
-namespace dr2335 { // dr2335: no drafting 2018-06-04
+namespace dr2335 { // dr2335: no drafting 2018-06
 // FIXME: current consensus is that the examples are well-formed.
 #if __cplusplus >= 201402L
 namespace ex1 {
diff --git a/clang/test/CXX/drs/dr4xx.cpp b/clang/test/CXX/drs/dr4xx.cpp
index 2f11c92f86aca3..612a152aec4c4d 100644
--- a/clang/test/CXX/drs/dr4xx.cpp
+++ b/clang/test/CXX/drs/dr4xx.cpp
@@ -1055,7 +1055,7 @@ namespace dr471 { // dr471: 2.8
   //   expected-note@#dr471-G-using {{declared private here}}
 }
 
-namespace dr472 { // dr472: no drafting
+namespace dr472 { // dr472: no drafting 2011-04
 struct B {
   int i; // #dr472-i
 };
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 0a56eb1bdbb4e0..6f24b03454c67b 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -2872,7 +2872,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/472.html">472</a></td>
     <td>drafting</td>
     <td>Casting across protected inheritance</td>
-    <td title="Clang does not implement 2011-04-00 resolution" align="center">Not Resolved*</td>
+    <td title="Clang does not implement 2011-04 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="473">
     <td><a href="https://cplusplus.github.io/CWG/issues/473.html">473</a></td>
@@ -13818,7 +13818,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2335.html">2335</a></td>
     <td>drafting</td>
     <td>Deduced return types vs member types</td>
-    <td title="Clang does not implement 2018-06-04 resolution" align="center">Not Resolved*</td>
+    <td title="Clang does not implement 2018-06 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="2336">
     <td><a href="https://cplusplus.github.io/CWG/issues/2336.html">2336</a></td>
diff --git a/clang/www/make_cxx_dr_status b/clang/www/make_cxx_dr_status
index 019355e6e1a6b5..2c937ce6e4f3a0 100755
--- a/clang/www/make_cxx_dr_status
+++ b/clang/www/make_cxx_dr_status
@@ -142,7 +142,7 @@ def availability(issue):
   unresolved_status_match = re.search(r' (open|drafting|review)', status)
   if unresolved_status_match:
     unresolved_status = unresolved_status_match.group(1)
-    proposed_resolution_match = re.search(r' (open|drafting|review) (\d{4}-\d{2}-\d{2}|P\d{4}R\d+)', status)
+    proposed_resolution_match = re.search(r' (open|drafting|review) (\d{4}-\d{2}(?:-\d{2})?|P\d{4}R\d+)$', status)
     if proposed_resolution_match is None:
       raise AvailabilityError('Issue {}: \'{}\' status should be followed by a paper number (P1234R5) or proposed resolution in YYYY-MM-DD format'.format(dr.issue, unresolved_status))
     proposed_resolution = proposed_resolution_match.group(2)

>From d60297a47d8a1736804fc925ade5d57bc6832dca Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: Fri, 9 Feb 2024 14:50:38 +0300
Subject: [PATCH 4/5] Remove '.0' from text referring to new versions of Clang

---
 clang/www/cxx_dr_status.html | 16 ++++++++--------
 clang/www/make_cxx_dr_status |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 6f24b03454c67b..68b9583a33d2b9 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -7146,7 +7146,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/1223.html">1223</a></td>
     <td>drafting</td>
     <td>Syntactic disambiguation and <I>trailing-return-type</I>s</td>
-    <td title="Clang 17.0 implements 2023-05-12 resolution" align="center">Not Resolved*</td>
+    <td title="Clang 17 implements 2023-05-12 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="1224">
     <td><a href="https://cplusplus.github.io/CWG/issues/1224.html">1224</a></td>
@@ -12102,7 +12102,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2049.html">2049</a></td>
     <td>drafting</td>
     <td>List initializer in non-type template default argument</td>
-    <td title="Clang 18.0 implements P2308R1 resolution" align="center">Not Resolved*</td>
+    <td title="Clang 18 implements P2308R1 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="2050">
     <td><a href="https://cplusplus.github.io/CWG/issues/2050.html">2050</a></td>
@@ -14508,7 +14508,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2450.html">2450</a></td>
     <td>review</td>
     <td><I>braced-init-list</I> as a <I>template-argument</I></td>
-    <td title="Clang 18.0 implements P2308R1 resolution" align="center">Not Resolved*</td>
+    <td title="Clang 18 implements P2308R1 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="2451">
     <td><a href="https://cplusplus.github.io/CWG/issues/2451.html">2451</a></td>
@@ -14562,7 +14562,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2459.html">2459</a></td>
     <td>drafting</td>
     <td>Template parameter initialization</td>
-    <td title="Clang 18.0 implements P2308R1 resolution" align="center">Not Resolved*</td>
+    <td title="Clang 18 implements P2308R1 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr id="2460">
     <td><a href="https://cplusplus.github.io/CWG/issues/2460.html">2460</a></td>
@@ -15126,13 +15126,13 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2553.html">2553</a></td>
     <td>review</td>
     <td>Restrictions on explicit object member functions</td>
-    <td title="Clang 18.0 implements 2023-07-14 resolution" align="center">Not Resolved*</td>
+    <td title="Clang 18 implements 2023-07-14 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr class="open" id="2554">
     <td><a href="https://cplusplus.github.io/CWG/issues/2554.html">2554</a></td>
     <td>review</td>
     <td>Overriding virtual functions, also with explicit object parameters</td>
-    <td title="Clang 18.0 implements 2021-12-10 resolution" align="center">Not Resolved*</td>
+    <td title="Clang 18 implements 2021-12-10 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr class="open" id="2555">
     <td><a href="https://cplusplus.github.io/CWG/issues/2555.html">2555</a></td>
@@ -15174,7 +15174,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2561.html">2561</a></td>
     <td>review</td>
     <td>Conversion to function pointer for lambda with explicit object parameter</td>
-    <td title="Clang 18.0 implements 2023-11-09 resolution" align="center">Not Resolved*</td>
+    <td title="Clang 18 implements 2023-11-09 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr class="open" id="2562">
     <td><a href="https://cplusplus.github.io/CWG/issues/2562.html">2562</a></td>
@@ -15198,7 +15198,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2565.html">2565</a></td>
     <td>open</td>
     <td>Invalid types in the <I>parameter-declaration-clause</I> of a <I>requires-expression</I></td>
-    <td title="Clang 16.0 implements 2023-06-07 resolution" align="center">Not Resolved*</td>
+    <td title="Clang 16 implements 2023-06-07 resolution" align="center">Not Resolved*</td>
   </tr>
   <tr class="open" id="2566">
     <td><a href="https://cplusplus.github.io/CWG/issues/2566.html">2566</a></td>
diff --git a/clang/www/make_cxx_dr_status b/clang/www/make_cxx_dr_status
index 2c937ce6e4f3a0..38f847cdc1b7f9 100755
--- a/clang/www/make_cxx_dr_status
+++ b/clang/www/make_cxx_dr_status
@@ -174,7 +174,7 @@ def availability(issue):
         avail_style = ' class="full"'
     else: 
       avail = 'Not Resolved*'
-      avail_style = f' title="Clang {float(status)} implements {proposed_resolution} resolution"'
+      avail_style = f' title="Clang {status} implements {proposed_resolution} resolution"'
   elif status == 'yes':
     if not proposed_resolution:
       avail = 'Yes'

>From 645f41e25e10aea1b2f2f1700350ac6a07c5d3ad Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: Thu, 15 Feb 2024 18:39:27 +0300
Subject: [PATCH 5/5] Regenerate cxx_dr_status.html

---
 clang/www/cxx_dr_status.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index f80e776a1dc5b7..e9b18b1e283e66 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -13986,7 +13986,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/2363.html">2363</a></td>
     <td>NAD</td>
     <td>Opaque enumeration friend declarations</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="2364">
     <td><a href="https://cplusplus.github.io/CWG/issues/2364.html">2364</a></td>



More information about the cfe-commits mailing list