-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[clang] Do less advertising for unresolved issues in cxx_dr_status.html
#78836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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: llvm#67948 (comment)
@llvm/pr-subscribers-clang Author: Vlad Serebrennikov (Endilll) ChangesThis patch prevents tests for unresolved issues to report availability (e.g. Because of aforementioned points, availability comment syntax is now simpler for tests for unresolved issues. What was previously written as This has been discussed in a PR for CWG472 test: #67948 Full diff: https://github.com/llvm/llvm-project/pull/78836.diff 9 Files Affected:
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@-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
|
clang/test/CXX/drs/dr20xx.cpp
Outdated
@@ -90,7 +90,7 @@ namespace dr2026 { // dr2026: 11 | |||
} | |||
} | |||
|
|||
namespace dr2049 { // dr2049: 18 drafting | |||
namespace dr2049 { // dr2049: drafting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang/test/CXX/drs/dr24xx.cpp
Outdated
@@ -45,7 +45,7 @@ void fallthrough(int n) { | |||
#endif | |||
} | |||
|
|||
namespace dr2450 { // dr2450: 18 review | |||
namespace dr2450 { // dr2450: review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang/test/CXX/drs/dr24xx.cpp
Outdated
@@ -59,7 +59,7 @@ f<{.a= 0}>(); | |||
#endif | |||
} | |||
|
|||
namespace dr2459 { // dr2459: 18 drafting | |||
namespace dr2459 { // dr2459: drafting |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang/test/CXX/drs/dr25xx.cpp
Outdated
@@ -83,7 +83,7 @@ using ::dr2521::operator""_div; | |||
|
|||
|
|||
#if __cplusplus >= 202302L | |||
namespace dr2553 { // dr2553: 18 review | |||
namespace dr2553 { // dr2553: review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the deducing this issue have agreement in core and i think we should signal we implement them.
I am slightly concerned with this direction. I would prefer that if we are fairly certain of the status of an issue we keep a version number (and if we are not, then we don't) |
@cor3ntin During our offline discussion with @AaronBallman, points "we don't want to read tea leaves" and "CWG can change their opinion" were repeated so often, that I thought we have consensus on using only official source on information, i.e. issue list. I also don't see why it's so necessary to be ahead of the committee when it requires insider knowledge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Getting rid of yes on issues that have been resolved but not yet published or are in a similar high-confidence scenario removes useful information and I really would like us not to do that.
For unresolved issues currently marked as unimplemented, it is probably a good thing to just say unresolved. That we do not implement something for which the resolution is unclear is not useful information to our users.
For issues implemented but unresolved (ie yes/clang xx). these are implementing a particular proposed resolution (either because 1/ we are confident the resolution has been or is going to be resolved as proposed or because we think the resolution make sense and is important to implement) and that offers useful information. We should keep that information.
We could clarify further with a footnote along the line of "This issue has not been resolved by the C++ committee and its resolution is subject to change".
Also enable the script to issue more than one error about bad status.
cxx_dr_status.html
cxx_dr_status.html
@AaronBallman I updated this PR following our offline discussion. Title, description, contents are basically all new. @cor3ntin It would be nice if you can go over your tests to check that date or paper number is what you want them to be. I filled them in based on latest resolution published at the time they were committed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the no case, I would leave it unknown / no comment... that we don't do something is not useful information for users. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why we don't want to report this, if we report that some unresolved issues are available. For instance, I find it useful to mention that we test proposed resolution for 2335, and decided it's not available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tend to agree; if we're telling users "there's some drafting and we do what the drafting said as of XXX", then there's similar value in telling users "there's some drafting and we do not do what the drafting said as of XXX" (for example, as the issue is resolved, it tells us that we can convert it into a No instead of an Unknown).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't agree (because telling users we don;t do something does not tell them what we do), but I will bow to whatever decision @AaronBallman takes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should leave it. I agree that it doesn't tell users what we're actually doing, but the point here is more for a user who reads the draft wording and says "Clang isn't doing what that says, is that a bug?" without really realizing that "drafting" status may mean we don't want to work on the issue until a final decision has been reached. If we explicitly say "we don't do what the current drafting says", it at least tells the user "we're aware of the issue, don't expect us to do what the current drafting says".
avail = 'Not Resolved*' | ||
avail_style = f' title="Clang partially implements {proposed_resolution} resolution"' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this case happen?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't have examples at the moment, but I think it's possible to only partially implement a proposed resolution in the same way one can partially implement an approved resolution: // dr1234: partial drafting 2024-02-13
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine keeping it on the assumption it might be used in the future, but I'm also fine stripping it out on the assumption that it's easy enough to add support for once we have an actual need for it.
@Endilll feel free to merge when Aaron is happy :) |
Windows CI didn't pass due to unrelated test failure. Landing. |
This patch places additional requirement on tests for open issues to specify what do they test, and reduce their advertising on
cxx_dr_status.html
.Tests for open issues have to either provide date of the proposed resolution they test, or a paper number that attempts to resolve the issue. Examples from this patch:
// dr1223: 17 drafting 2023-05-12
,// dr2049: 18 drafting P2308R1
,// dr2335: no drafting 2018-06
.Tests for open issues are no longer advertised in
cxx_dr_status.html
as tests for resolved issues. Instead, they are specified asNot Resolved*
(note the asterisk). Such statuses have a tooltip with the following kind of text:Clang 17 implements 2023-05-12 resolution
Clang does not implement 2018-06-04 resolution
Clang 18 implements P2308R1 resolution
I admit that the wording is a bit crude, but I tried to minimize amount of boilerplate in the
make_cxx_dr_status
. Hopefully, this whole setup matches C++ compiler support page on cppreference enough for people to catch up.This patch also implement a quality-of-life feature for users of
make_cxx_dr_status
: now script is able to report multiple bad// dr
comments in a single run.This has also been discussed in a PR for CWG472 test: #67948