[clang] [clang] Stop reporting unresolved issues in `cxx_dr_status.html` (PR #78836)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Sat Jan 20 01:08:54 PST 2024


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

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

>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] [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 cb4cc5aef173711..aaedbe916dc2132 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 0245f03986dd73c..f6c94f32506cb2c 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 f7f37379e61ad14..016ba4e2ccb85d5 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 d143aaf7cb0ac04..ac0193db06bdb7c 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 d8556998315c777..0f87904c860b61b 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 66e9cf5a677f800..a4d40fa96b66f4c 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 502f03271d9afe2..b28abc4166e3a0c 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 b29a746bcf6e8a4..d58ca825d8af70d 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 b0898ac25b72202..09858473ce7d83d 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



More information about the cfe-commits mailing list