1 #! /usr/bin/env python3
4 index = 'cwg_index.html'
5 output = 'cxx_dr_status.html'
6 dr_test_dir = '../test/CXX/drs'
10 elif len(sys.argv) == 2:
13 print('Usage: make_drs [<path to cwg_index.html>]', file=sys.stderr)
17 def __init__(self, section, issue, url, status, title):
18 self.section, self.issue, self.url, self.status, self.title = \
19 section, issue, url, status, title
21 return '%s (%s): %s' % (self.issue, self.status, self.title)
24 section, issue_link, status, liaison, title = [
25 col.split('>', 1)[1].split('</TD>')[0]
26 for col in dr.split('</TR>', 1)[0].split('<TD')[1:]
28 _, url, issue = issue_link.split('"', 2)
30 issue = int(issue.split('>', 1)[1].split('<', 1)[0])
31 title = title.replace('<issue_title>', '').replace('</issue_title>', '').replace('\r\n', '\n').strip()
32 return DR(section, issue, url, status, title)
34 status_re = re.compile(r'\bdr([0-9]+): (.*)')
36 for test_cpp in os.listdir(dr_test_dir):
37 if not test_cpp.endswith('.cpp'):
39 test_cpp = os.path.join(dr_test_dir, test_cpp)
41 for match in re.finditer(status_re, open(test_cpp, 'r').read()):
42 status_map[int(match.group(1))] = match.group(2)
45 print("warning:%s: no '// dr123: foo' comments in this file" % test_cpp, file=sys.stderr)
47 drs = sorted((parse(dr) for dr in open(index, 'r').read().split('<TR>')[2:]),
48 key = lambda dr: dr.issue)
49 out_file = open(output, 'w')
51 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
52 "http://www.w3.org/TR/html4/strict.dtd">
53 <!-- This file is auto-generated by make_cxx_dr_status. Do not modify. -->
56 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
57 <title>Clang - C++ Defect Report Status</title>
58 <link type="text/css" rel="stylesheet" href="menu.css">
59 <link type="text/css" rel="stylesheet" href="content.css">
60 <style type="text/css">
61 .none { background-color: #FFCCCC }
62 .partial { background-color: #FFE0B0 }
63 .unreleased { background-color: #FFFF99 }
64 .full { background-color: #CCFF99 }
65 .na { background-color: #DDDDDD }
66 .open * { color: #AAAAAA }
67 //.open { filter: opacity(0.2) }
68 tr:target { background-color: #FFFFBB }
69 th { background-color: #FFDDAA }
74 <!--#include virtual="menu.html.incl"-->
78 <!--*************************************************************************-->
79 <h1>C++ Defect Report Support in Clang</h1>
80 <!--*************************************************************************-->
82 <h2 id="cxxdr">C++ defect report implementation status</h2>
84 <p>This page tracks which C++ defect reports are implemented within Clang.</p>
86 <table width="689" border="1" cellspacing="0">
91 <th>Available in Clang?</th>
96 def availability(issue):
97 status = status_map.get(issue, 'unknown')
99 if status.endswith(' c++11'):
101 avail_suffix = ' (C++11 onwards)'
102 elif status.endswith(' c++14'):
104 avail_suffix = ' (C++14 onwards)'
105 elif status.endswith(' c++17'):
107 avail_suffix = ' (C++17 onwards)'
108 if status == 'unknown':
110 avail_style = ' class="none"'
111 elif re.match('^[0-9]+\.?[0-9]*', status):
112 avail = 'Clang %s' % status
113 if float(status) > latest_release:
114 avail_style = ' class="unreleased"'
116 avail_style = ' class="full"'
117 elif status == 'yes':
119 avail_style = ' class="full"'
120 elif status == 'partial':
122 avail_style = ' class="partial"'
125 avail_style = ' class="none"'
128 avail_style = ' class="na"'
129 elif status == 'na lib':
130 avail = 'N/A (Library DR)'
131 avail_style = ' class="na"'
132 elif status == 'na abi':
133 avail = 'N/A (ABI constraint)'
134 avail_style = ' class="na"'
135 elif status.startswith('sup '):
136 dup = status.split(' ', 1)[1]
137 if dup.startswith('P'):
138 avail = 'Superseded by <a href="https://wg21.link/%s">%s</a>' % (dup, dup)
139 avail_style = ' class="na"'
141 avail = 'Superseded by <a href="#%s">%s</a>' % (dup, dup)
143 _, avail_style = availability(int(dup))
145 print("issue %s marked as sup %s" % (issue, dup), file=sys.stderr)
146 avail_style = ' class="none"'
147 elif status.startswith('dup '):
148 dup = int(status.split(' ', 1)[1])
149 avail = 'Duplicate of <a href="#%s">%s</a>' % (dup, dup)
150 _, avail_style = availability(dup)
152 assert False, 'unknown status %s for issue %s' % (status, dr.issue)
153 return (avail + avail_suffix, avail_style)
157 if dr.status in ('concepts',):
158 # This refers to the old ("C++0x") concepts feature, which was not part
159 # of any C++ International Standard or Technical Specification.
161 if dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'):
162 # We may have to deal with these some day, but not yet.
163 row_style = ' class="open"'
164 if dr.status == 'extension':
167 avail = 'Not resolved'
169 assert dr.issue not in status_map, "have status for not-ready dr %s" % dr.issue
172 avail, avail_style = availability(dr.issue)
173 if not avail.startswith('Sup') and not avail.startswith('Dup'):
174 count[avail] = count.get(avail, 0) + 1
178 <td><a href="https://wg21.link/cwg%s">%s</a></td>
181 <td%s align="center">%s</td>
182 </tr>''' % (row_style, dr.issue, dr.issue, dr.issue, dr.status, dr.title, avail_style, avail))
184 for status, num in sorted(count.items()):
185 print("%s: %s" % (status, num))