Endill created this revision. Endill added reviewers: erichkeane, ychen, clang-language-wg. Herald added a project: All. Endill requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
A follow-up to D136133 <https://reviews.llvm.org/D136133>. It was mentioned in #58382 <https://github.com/llvm/llvm-project/issues/58382#issuecomment-1281874338> that there is a need to test for DRs that have not been officially resolved yet. This patch aims to replace original "hackery" with proper handling for such cases. Highlights: - Availability can be suffixed (further) with "open", "drafting", or "review", e.g. `// dr2565: 16 open`, `// drXXXX: 16 c++17 drafting` - Checks are implemented to ensure that this suffix corresponds to actual issue status - Non-resolved DRs are counted (stdout of make_cxx_dr_status) - No changes made to cxx_dr_status.html - 'c++20' availability suffix added - Remove 'concurrency' status since it's no longer on the list of statuses in CWG Active Issues Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D138901 Files: clang/test/CXX/drs/dr25xx.cpp clang/test/CXX/drs/dr26xx.cpp clang/www/make_cxx_dr_status
Index: clang/www/make_cxx_dr_status =================================================================== --- clang/www/make_cxx_dr_status +++ clang/www/make_cxx_dr_status @@ -95,6 +95,18 @@ 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] @@ -105,6 +117,9 @@ elif status.endswith(' c++17'): status = status[:-6] avail_suffix = ' (C++17 onwards)' + elif status.endswith(' c++20'): + status = status[:-6] + avail_suffix = ' (C++20 onwards)' if status == 'unknown': avail = 'Unknown' avail_style = ' class="none"' @@ -140,17 +155,17 @@ 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) else: assert False, 'unknown status %s for issue %s' % (status, dr.issue) - return (avail + avail_suffix, avail_style) + return (avail + avail_suffix, avail_style, unresolved_status) count = {} for dr in drs: @@ -158,21 +173,28 @@ # This refers to the old ("C++0x") concepts feature, which was not part # of any C++ International Standard or Technical Specification. continue - if dr.issue in (2565, 2628): + elif dr.status == 'extension': row_style = ' class="open"' - avail, avail_style = availability(dr.issue) - elif dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'): - # We may have to deal with these some day, but not yet. + avail = 'Extension' + avail_style = '' + elif dr.status in ('open', 'drafting', 'review'): row_style = ' class="open"' - if dr.status == 'extension': - avail = 'Extension' - else: + avail, avail_style, unresolved_status = availability(dr.issue) + if avail == 'Unknown': avail = 'Not resolved' - avail_style = '' - assert dr.issue not in status_map, "have status for not-ready dr %s" % dr.issue + 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) + if not avail.startswith('Sup') and not avail.startswith('Dup'): + count[avail] = count.get(avail, 0) + 1 else: row_style = '' - avail, avail_style = availability(dr.issue) + avail, avail_style, unresolved_status = availability(dr.issue) + assert not unresolved_status, \ + "Issue %s is marked '%s', even though it is resolved in CWG index" \ + % (dr.issue, unresolved_status) if not avail.startswith('Sup') and not avail.startswith('Dup'): count[avail] = count.get(avail, 0) + 1 Index: clang/test/CXX/drs/dr26xx.cpp =================================================================== --- clang/test/CXX/drs/dr26xx.cpp +++ clang/test/CXX/drs/dr26xx.cpp @@ -14,7 +14,7 @@ } } -namespace dr2628 { // dr2628: yes +namespace dr2628 { // dr2628: yes open template <bool A = false, bool B = false> struct foo { Index: clang/test/CXX/drs/dr25xx.cpp =================================================================== --- clang/test/CXX/drs/dr25xx.cpp +++ clang/test/CXX/drs/dr25xx.cpp @@ -1,6 +1,6 @@ // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown %s -verify -namespace dr2565 { // dr2565: 16 +namespace dr2565 { // dr2565: 16 open template<typename T> concept C = requires (typename T::type x) { x + 1;
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits