Skip to content

Commit fc39cc1

Browse files
authored
[clang] Minor updates to C++ DR page design (#106360)
This patch updates `make_cxx_dr_status` script to use the same spoiler-like way to hide additional details that `cxx_status.html` uses. This gives implemented yet unresolved DRs new but very familiar look: ![s9EpO0E](https://github.com/user-attachments/assets/54852d7b-5fdd-4595-8dca-20628797f952) I also took an opportunity to fix spelling inconsistency pointed out by @zygoloid in #106299 (comment). I got tired of counting `%s`s when we substitute data into HTML template, so I replaced them with an f-string (available since Python 3.6), because I had to touch this code anyway.
1 parent 8b198ee commit fc39cc1

File tree

2 files changed

+86
-31
lines changed

2 files changed

+86
-31
lines changed

clang/www/cxx_dr_status.html

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2879,7 +2879,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
28792879
<td><a href="https://cplusplus.github.io/CWG/issues/472.html">472</a></td>
28802880
<td>drafting</td>
28812881
<td>Casting across protected inheritance</td>
2882-
<td title="Clang does not implement 2011-04 resolution" align="center">Not Resolved*</td>
2882+
<td align="center">
2883+
<details>
2884+
<summary>Not resolved</summary>
2885+
Clang does not implement 2011-04 resolution
2886+
</details></td>
28832887
</tr>
28842888
<tr id="473">
28852889
<td><a href="https://cplusplus.github.io/CWG/issues/473.html">473</a></td>
@@ -7153,7 +7157,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
71537157
<td><a href="https://cplusplus.github.io/CWG/issues/1223.html">1223</a></td>
71547158
<td>drafting</td>
71557159
<td>Syntactic disambiguation and <I>trailing-return-type</I>s</td>
7156-
<td title="Clang 17 implements 2023-05-12 resolution" align="center">Not Resolved*</td>
7160+
<td align="center">
7161+
<details>
7162+
<summary>Not resolved</summary>
7163+
Clang 17 implements 2023-05-12 resolution
7164+
</details></td>
71577165
</tr>
71587166
<tr id="1224">
71597167
<td><a href="https://cplusplus.github.io/CWG/issues/1224.html">1224</a></td>
@@ -9319,7 +9327,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
93199327
<td><a href="https://cplusplus.github.io/CWG/issues/1584.html">1584</a></td>
93209328
<td>drafting</td>
93219329
<td>Deducing function types from cv-qualified types</td>
9322-
<td title="Clang 7 implements 2015-05 resolution" align="center">Not Resolved*</td>
9330+
<td align="center">
9331+
<details>
9332+
<summary>Not resolved</summary>
9333+
Clang 7 implements 2015-05 resolution
9334+
</details></td>
93239335
</tr>
93249336
<tr id="1585">
93259337
<td><a href="https://cplusplus.github.io/CWG/issues/1585.html">1585</a></td>
@@ -11155,7 +11167,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1115511167
<td><a href="https://cplusplus.github.io/CWG/issues/1890.html">1890</a></td>
1115611168
<td>drafting</td>
1115711169
<td>Member type depending on definition of member function</td>
11158-
<td title="Clang does not implement 2018-06-04 resolution" align="center">Not Resolved*</td>
11170+
<td align="center">
11171+
<details>
11172+
<summary>Not resolved</summary>
11173+
Clang does not implement 2018-06-04 resolution
11174+
</details></td>
1115911175
</tr>
1116011176
<tr id="1891">
1116111177
<td><a href="https://cplusplus.github.io/CWG/issues/1891.html">1891</a></td>
@@ -13825,7 +13841,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1382513841
<td><a href="https://cplusplus.github.io/CWG/issues/2335.html">2335</a></td>
1382613842
<td>drafting</td>
1382713843
<td>Deduced return types vs member types</td>
13828-
<td title="Clang does not implement 2018-06 resolution" align="center">Not Resolved*</td>
13844+
<td align="center">
13845+
<details>
13846+
<summary>Not resolved</summary>
13847+
Clang does not implement 2018-06 resolution
13848+
</details></td>
1382913849
</tr>
1383013850
<tr id="2336">
1383113851
<td><a href="https://cplusplus.github.io/CWG/issues/2336.html">2336</a></td>
@@ -15133,13 +15153,21 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1513315153
<td><a href="https://cplusplus.github.io/CWG/issues/2553.html">2553</a></td>
1513415154
<td>review</td>
1513515155
<td>Restrictions on explicit object member functions</td>
15136-
<td title="Clang 18 implements 2023-07-14 resolution" align="center">Not Resolved*</td>
15156+
<td align="center">
15157+
<details>
15158+
<summary>Not resolved</summary>
15159+
Clang 18 implements 2023-07-14 resolution
15160+
</details></td>
1513715161
</tr>
1513815162
<tr class="open" id="2554">
1513915163
<td><a href="https://cplusplus.github.io/CWG/issues/2554.html">2554</a></td>
1514015164
<td>review</td>
1514115165
<td>Overriding virtual functions, also with explicit object parameters</td>
15142-
<td title="Clang 18 implements 2021-12-10 resolution" align="center">Not Resolved*</td>
15166+
<td align="center">
15167+
<details>
15168+
<summary>Not resolved</summary>
15169+
Clang 18 implements 2021-12-10 resolution
15170+
</details></td>
1514315171
</tr>
1514415172
<tr class="open" id="2555">
1514515173
<td><a href="https://cplusplus.github.io/CWG/issues/2555.html">2555</a></td>
@@ -15205,7 +15233,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1520515233
<td><a href="https://cplusplus.github.io/CWG/issues/2565.html">2565</a></td>
1520615234
<td>open</td>
1520715235
<td>Invalid types in the <I>parameter-declaration-clause</I> of a <I>requires-expression</I></td>
15208-
<td title="Clang 16 implements 2023-06-07 resolution" align="center">Not Resolved*</td>
15236+
<td align="center">
15237+
<details>
15238+
<summary>Not resolved</summary>
15239+
Clang 16 implements 2023-06-07 resolution
15240+
</details></td>
1520915241
</tr>
1521015242
<tr class="open" id="2566">
1521115243
<td><a href="https://cplusplus.github.io/CWG/issues/2566.html">2566</a></td>
@@ -16898,7 +16930,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1689816930
<td><a href="https://cplusplus.github.io/CWG/issues/2847.html">2847</a></td>
1689916931
<td>review</td>
1690016932
<td>Constrained explicit specializations of function templates at class scope</td>
16901-
<td title="Clang 19 implements 2024-03-01 resolution" align="center">Not Resolved*</td>
16933+
<td align="center">
16934+
<details>
16935+
<summary>Not resolved</summary>
16936+
Clang 19 implements 2024-03-01 resolution
16937+
</details></td>
1690216938
</tr>
1690316939
<tr id="2848">
1690416940
<td><a href="https://cplusplus.github.io/CWG/issues/2848.html">2848</a></td>
@@ -17126,7 +17162,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1712617162
<td><a href="https://cplusplus.github.io/CWG/issues/2885.html">2885</a></td>
1712717163
<td>review</td>
1712817164
<td>Non-eligible trivial default constructors</td>
17129-
<td title="Clang 16 implements 2024-05-31 resolution" align="center">Not Resolved*</td>
17165+
<td align="center">
17166+
<details>
17167+
<summary>Not resolved</summary>
17168+
Clang 16 implements 2024-05-31 resolution
17169+
</details></td>
1713017170
</tr>
1713117171
<tr id="2886">
1713217172
<td><a href="https://cplusplus.github.io/CWG/issues/2886.html">2886</a></td>
@@ -17318,7 +17358,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1731817358
<td><a href="https://cplusplus.github.io/CWG/issues/2917.html">2917</a></td>
1731917359
<td>review</td>
1732017360
<td>Disallow multiple <I>friend-type-specifier</I>s for a friend template</td>
17321-
<td title="Clang 20 implements 2024-07-30 resolution" align="center">Not Resolved*</td>
17361+
<td align="center">
17362+
<details>
17363+
<summary>Not resolved</summary>
17364+
Clang 20 implements 2024-07-30 resolution
17365+
</details></td>
1732217366
</tr>
1732317367
<tr class="open" id="2918">
1732417368
<td><a href="https://cplusplus.github.io/CWG/issues/2918.html">2918</a></td>
@@ -17348,7 +17392,11 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
1734817392
<td><a href="https://cplusplus.github.io/CWG/issues/2922.html">2922</a></td>
1734917393
<td>tentatively ready</td>
1735017394
<td>constexpr placement-new is too permissive</td>
17351-
<td title="Clang 20 implements 2024-07-10 resolution" align="center">Not Resolved*</td>
17395+
<td align="center">
17396+
<details>
17397+
<summary>Not resolved</summary>
17398+
Clang 20 implements 2024-07-10 resolution
17399+
</details></td>
1735217400
</tr>
1735317401
<tr class="open" id="2923">
1735417402
<td><a href="https://cplusplus.github.io/CWG/issues/2923.html">2923</a></td>

clang/www/make_cxx_dr_status

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def availability(issue):
156156

157157
avail_suffix = ''
158158
avail_style = ''
159-
tooltip = ''
159+
details = ''
160160
if status.endswith(' c++11'):
161161
status = status[:-6]
162162
avail_suffix = ' (C++11 onwards)'
@@ -180,29 +180,29 @@ def availability(issue):
180180
else:
181181
avail_style = 'full'
182182
else:
183-
avail = 'Not Resolved*'
184-
tooltip = f' title="Clang {status} implements {proposed_resolution} resolution"'
183+
avail = 'Not resolved'
184+
details = f'Clang {status} implements {proposed_resolution} resolution'
185185
elif status == 'yes':
186186
if not proposed_resolution:
187187
avail = 'Yes'
188188
avail_style = 'full'
189189
else:
190-
avail = 'Not Resolved*'
191-
tooltip = f' title="Clang implements {proposed_resolution} resolution"'
190+
avail = 'Not resolved'
191+
details = f'Clang implements {proposed_resolution} resolution'
192192
elif status == 'partial':
193193
if not proposed_resolution:
194194
avail = 'Partial'
195195
avail_style = 'partial'
196196
else:
197-
avail = 'Not Resolved*'
198-
tooltip = f' title="Clang partially implements {proposed_resolution} resolution"'
197+
avail = 'Not resolved'
198+
details = f'Clang partially implements {proposed_resolution} resolution'
199199
elif status == 'no':
200200
if not proposed_resolution:
201201
avail = 'No'
202202
avail_style = 'none'
203203
else:
204-
avail = 'Not Resolved*'
205-
tooltip = f' title="Clang does not implement {proposed_resolution} resolution"'
204+
avail = 'Not resolved'
205+
details = f'Clang does not implement {proposed_resolution} resolution'
206206
elif status == 'na':
207207
avail = 'N/A'
208208
avail_style = 'na'
@@ -231,7 +231,7 @@ def availability(issue):
231231
_, avail_style, _, _ = availability(dup)
232232
else:
233233
raise AvailabilityError('Unknown status %s for issue %s' % (status, dr.issue))
234-
return (avail + avail_suffix, avail_style, unresolved_status, tooltip)
234+
return (avail + avail_suffix, avail_style, unresolved_status, details)
235235

236236
count = {}
237237
for dr in drs:
@@ -248,7 +248,7 @@ for dr in drs:
248248
elif dr.status in ('open', 'drafting', 'review', 'tentatively ready', 'ready'):
249249
row_style = ' class="open"'
250250
try:
251-
avail, avail_style, unresolved_status, tooltip = availability(dr.issue)
251+
avail, avail_style, unresolved_status, details = availability(dr.issue)
252252
except AvailabilityError as e:
253253
availability_error_occurred = True
254254
print(e.args[0])
@@ -266,7 +266,7 @@ for dr in drs:
266266
else:
267267
row_style = ''
268268
try:
269-
avail, avail_style, unresolved_status, tooltip = availability(dr.issue)
269+
avail, avail_style, unresolved_status, details = availability(dr.issue)
270270
except AvailabilityError as e:
271271
availability_error_occurred = True
272272
print(e.args[0])
@@ -283,13 +283,20 @@ for dr in drs:
283283

284284
if avail_style != '':
285285
avail_style = ' class="{}"'.format(avail_style)
286-
out_file.write('''
287-
<tr%s id="%s">
288-
<td><a href="https://cplusplus.github.io/CWG/issues/%s.html">%s</a></td>
289-
<td>%s</td>
290-
<td>%s</td>
291-
<td%s%s align="center">%s</td>
292-
</tr>''' % (row_style, dr.issue, dr.issue, dr.issue, dr.status, dr.title, avail_style, tooltip, avail))
286+
287+
if details != '':
288+
avail = f'''
289+
<details>
290+
<summary>{avail}</summary>
291+
{details}
292+
</details>'''
293+
out_file.write(f'''
294+
<tr{row_style} id="{dr.issue}">
295+
<td><a href="https://cplusplus.github.io/CWG/issues/{dr.issue}.html">{dr.issue}</a></td>
296+
<td>{dr.status}</td>
297+
<td>{dr.title}</td>
298+
<td{avail_style} align="center">{avail}</td>
299+
</tr>''')
293300

294301
if availability_error_occurred:
295302
exit(1)

0 commit comments

Comments
 (0)