2013-05-16 09:23:30 +08:00
|
|
|
#! /usr/bin/env python
|
2013-05-19 15:22:38 +08:00
|
|
|
import sys, os, re
|
2013-05-16 09:23:30 +08:00
|
|
|
|
|
|
|
index = 'cwg_index.html'
|
2013-05-19 15:22:38 +08:00
|
|
|
output = 'cxx_dr_status.html'
|
|
|
|
dr_test_dir = '../test/CXX/drs'
|
|
|
|
|
2013-05-16 09:23:30 +08:00
|
|
|
if len(sys.argv) == 1:
|
|
|
|
pass
|
|
|
|
elif len(sys.argv) == 2:
|
|
|
|
index = sys.argv[1]
|
|
|
|
else:
|
|
|
|
print >>sys.stderr, 'Usage: make_drs [<path to cwg_index.html>]'
|
|
|
|
sys.exit(1)
|
|
|
|
|
|
|
|
class DR:
|
|
|
|
def __init__(self, section, issue, url, status, title):
|
|
|
|
self.section, self.issue, self.url, self.status, self.title = \
|
|
|
|
section, issue, url, status, title
|
|
|
|
def __repr__(self):
|
|
|
|
return '%s (%s): %s' % (self.issue, self.status, self.title)
|
|
|
|
|
|
|
|
def parse(dr):
|
|
|
|
section, issue_link, status, title = [
|
|
|
|
col.split('>', 1)[1].split('</TD>')[0]
|
|
|
|
for col in dr.split('</TR>', 1)[0].split('<TD')[1:]
|
|
|
|
]
|
|
|
|
_, url, issue = issue_link.split('"', 2)
|
|
|
|
url = url.strip()
|
|
|
|
issue = int(issue.split('>', 1)[1].split('<', 1)[0])
|
|
|
|
title = title.replace('<issue_title>', '').replace('</issue_title>', '').strip()
|
|
|
|
return DR(section, issue, url, status, title)
|
|
|
|
|
2013-05-19 15:22:38 +08:00
|
|
|
status_re = re.compile(r'\bdr([0-9]+): (.*)')
|
|
|
|
status_map = {}
|
|
|
|
for test_cpp in os.listdir(dr_test_dir):
|
2013-05-27 06:03:53 +08:00
|
|
|
if not test_cpp.endswith('.cpp'):
|
|
|
|
continue
|
2013-05-19 15:22:38 +08:00
|
|
|
test_cpp = os.path.join(dr_test_dir, test_cpp)
|
|
|
|
found_any = False;
|
|
|
|
for match in re.finditer(status_re, file(test_cpp, 'r').read()):
|
|
|
|
status_map[int(match.group(1))] = match.group(2)
|
|
|
|
found_any = True
|
|
|
|
if not found_any:
|
|
|
|
print >> sys.stderr, "warning:%s: no '// dr123: foo' comments in this file" % test_cpp
|
|
|
|
|
2013-05-16 09:23:30 +08:00
|
|
|
drs = sorted((parse(dr) for dr in file(index, 'r').read().split('<TR>')[2:]),
|
|
|
|
key = lambda dr: dr.issue)
|
2013-05-19 15:22:38 +08:00
|
|
|
out_file = file(output, 'w')
|
2013-05-16 09:23:30 +08:00
|
|
|
|
2013-05-19 15:22:38 +08:00
|
|
|
print >> out_file, '''\
|
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
2013-05-16 09:23:30 +08:00
|
|
|
"http://www.w3.org/TR/html4/strict.dtd">
|
2013-12-06 05:08:20 +08:00
|
|
|
<!-- This file is auto-generated by make_cxx_dr_status. Do not modify. -->
|
2013-05-16 09:23:30 +08:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
|
|
|
<title>Clang - C++ Defect Report Status</title>
|
|
|
|
<link type="text/css" rel="stylesheet" href="menu.css">
|
|
|
|
<link type="text/css" rel="stylesheet" href="content.css">
|
|
|
|
<style type="text/css">
|
|
|
|
.none { background-color: #FFCCCC }
|
|
|
|
.partial { background-color: #FFE0B0 }
|
|
|
|
.svn { background-color: #FFFF99 }
|
|
|
|
.full { background-color: #CCFF99 }
|
|
|
|
.na { background-color: #DDDDDD }
|
|
|
|
.open * { color: #AAAAAA }
|
|
|
|
//.open { filter: opacity(0.2) }
|
2014-03-06 07:02:47 +08:00
|
|
|
tr:target { background-color: #FFFFBB }
|
2013-05-16 09:23:30 +08:00
|
|
|
th { background-color: #FFDDAA }
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<!--#include virtual="menu.html.incl"-->
|
|
|
|
|
|
|
|
<div id="content">
|
|
|
|
|
|
|
|
<!--*************************************************************************-->
|
|
|
|
<h1>C++ Defect Report Support in Clang</h1>
|
|
|
|
<!--*************************************************************************-->
|
|
|
|
<p>Last updated: $Date$</p>
|
|
|
|
|
|
|
|
<h2 id="cxxdr">C++ defect report implementation status</h2>
|
|
|
|
|
|
|
|
<p>This page tracks which C++ defect reports are implemented within Clang.</p>
|
|
|
|
|
|
|
|
<table width="689" border="1" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<th>Number</th>
|
|
|
|
<th>Status</th>
|
|
|
|
<th>Issue title</th>
|
|
|
|
<th>Available in Clang?</th>
|
|
|
|
</tr>'''
|
|
|
|
|
|
|
|
def availability(issue):
|
|
|
|
status = status_map.get(issue, 'unknown')
|
2013-11-17 14:39:43 +08:00
|
|
|
avail_suffix = ''
|
|
|
|
if status.endswith(' c++11'):
|
|
|
|
status = status[:-6]
|
|
|
|
avail_suffix = ' (C++11 onwards)'
|
2016-10-22 09:32:19 +08:00
|
|
|
elif status.endswith(' c++14'):
|
|
|
|
status = status[:-6]
|
|
|
|
avail_suffix = ' (C++14 onwards)'
|
|
|
|
elif status.endswith(' c++17'):
|
|
|
|
status = status[:-6]
|
|
|
|
avail_suffix = ' (C++17 onwards)'
|
2013-05-16 09:23:30 +08:00
|
|
|
if status == 'unknown':
|
|
|
|
avail = 'Unknown'
|
|
|
|
avail_style = ' class="none"'
|
2019-09-04 01:49:51 +08:00
|
|
|
elif status == '10':
|
2013-05-16 09:23:30 +08:00
|
|
|
avail = 'SVN'
|
|
|
|
avail_style = ' class="svn"'
|
2017-01-13 08:57:54 +08:00
|
|
|
elif re.match('^[0-9]+\.?[0-9]*', status):
|
2013-05-16 09:23:30 +08:00
|
|
|
avail = 'Clang %s' % status
|
|
|
|
avail_style = ' class="full"'
|
|
|
|
elif status == 'yes':
|
|
|
|
avail = 'Yes'
|
|
|
|
avail_style = ' class="full"'
|
|
|
|
elif status == 'partial':
|
|
|
|
avail = 'Partial'
|
|
|
|
avail_style = ' class="partial"'
|
|
|
|
elif status == 'no':
|
|
|
|
avail = 'No'
|
|
|
|
avail_style = ' class="none"'
|
|
|
|
elif status == 'na':
|
|
|
|
avail = 'N/A'
|
|
|
|
avail_style = ' class="na"'
|
2016-12-10 03:35:45 +08:00
|
|
|
elif status == 'na lib':
|
|
|
|
avail = 'N/A (Library DR)'
|
|
|
|
avail_style = ' class="na"'
|
2018-04-06 02:55:37 +08:00
|
|
|
elif status == 'na abi':
|
|
|
|
avail = 'N/A (ABI constraint)'
|
|
|
|
avail_style = ' class="na"'
|
2013-05-19 15:22:38 +08:00
|
|
|
elif status.startswith('sup '):
|
2013-05-27 06:03:53 +08:00
|
|
|
dup = status.split(' ', 1)[1]
|
2014-03-06 07:02:47 +08:00
|
|
|
avail = 'Superseded by <a href="#%s">%s</a>' % (dup, dup)
|
2013-05-27 06:03:53 +08:00
|
|
|
try:
|
|
|
|
_, avail_style = availability(int(dup))
|
|
|
|
except:
|
|
|
|
print >>sys.stderr, "issue %s marked as sup %s" % (issue, dup)
|
|
|
|
avail_style = ' class="none"'
|
2013-05-16 09:23:30 +08:00
|
|
|
elif status.startswith('dup '):
|
|
|
|
dup = int(status.split(' ', 1)[1])
|
2014-03-06 07:02:47 +08:00
|
|
|
avail = 'Duplicate of <a href="#%s">%s</a>' % (dup, dup)
|
2013-05-16 09:23:30 +08:00
|
|
|
_, avail_style = availability(dup)
|
|
|
|
else:
|
|
|
|
assert False, 'unknown status %s for issue %s' % (status, dr.issue)
|
2013-11-17 14:39:43 +08:00
|
|
|
return (avail + avail_suffix, avail_style)
|
2013-05-16 09:23:30 +08:00
|
|
|
|
2013-11-15 16:55:01 +08:00
|
|
|
count = {}
|
2013-05-16 09:23:30 +08:00
|
|
|
for dr in drs:
|
|
|
|
if dr.status in ('concepts',):
|
2019-05-09 11:45:57 +08:00
|
|
|
# This refers to the old ("C++0x") concepts feature, which was not part
|
|
|
|
# of any C++ International Standard or Technical Specification.
|
2013-05-16 09:23:30 +08:00
|
|
|
continue
|
|
|
|
if dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'):
|
|
|
|
# We may have to deal with these some day, but not yet.
|
|
|
|
row_style = ' class="open"'
|
2019-05-09 11:45:57 +08:00
|
|
|
if dr.status == 'extension':
|
|
|
|
avail = 'Extension'
|
|
|
|
else:
|
|
|
|
avail = 'Not resolved'
|
2013-05-16 09:23:30 +08:00
|
|
|
avail_style = ''
|
|
|
|
assert dr.issue not in status_map, "have status for not-ready dr %s" % dr.issue
|
|
|
|
else:
|
|
|
|
row_style = ''
|
|
|
|
avail, avail_style = availability(dr.issue)
|
2013-11-15 16:55:01 +08:00
|
|
|
if not avail.startswith('Sup') and not avail.startswith('Dup'):
|
|
|
|
count[avail] = count.get(avail, 0) + 1
|
2013-05-16 09:23:30 +08:00
|
|
|
|
2013-05-19 15:22:38 +08:00
|
|
|
print >> out_file, '''\
|
2014-03-06 07:02:47 +08:00
|
|
|
<tr%s id="%s">
|
2019-05-09 11:45:57 +08:00
|
|
|
<td><a href="http://wg21.link/cwg%s">%s</a></td>
|
2013-05-16 09:23:30 +08:00
|
|
|
<td>%s</td>
|
|
|
|
<td>%s</td>
|
|
|
|
<td%s align="center">%s</td>
|
2019-05-09 11:45:57 +08:00
|
|
|
</tr>''' % (row_style, dr.issue, dr.issue, dr.issue, dr.status, dr.title, avail_style, avail)
|
2013-05-16 09:23:30 +08:00
|
|
|
|
2016-10-22 09:32:19 +08:00
|
|
|
for status, num in sorted(count.items()):
|
2013-11-15 16:55:01 +08:00
|
|
|
print "%s: %s" % (status, num)
|
|
|
|
|
2013-05-19 15:22:38 +08:00
|
|
|
print >> out_file, '''\
|
|
|
|
</table>
|
2013-05-16 09:23:30 +08:00
|
|
|
|
|
|
|
</div>
|
|
|
|
</body>
|
|
|
|
</html>'''
|