mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-01-11 12:45:06 +08:00
mklog: support parsing of DR.
* mklog.py: Support DR parsing. * test_mklog.py: New test for DR parsing.
This commit is contained in:
parent
f094665d46
commit
e7c7cdc5f4
@ -1,3 +1,8 @@
|
|||||||
|
2020-05-21 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
|
* mklog.py: Support DR parsing.
|
||||||
|
* test_mklog.py: New test for DR parsing.
|
||||||
|
|
||||||
2020-05-20 Martin Liska <mliska@suse.cz>
|
2020-05-20 Martin Liska <mliska@suse.cz>
|
||||||
|
|
||||||
* gcc-changelog/git_commit.py: Add author_tuple
|
* gcc-changelog/git_commit.py: Add author_tuple
|
||||||
|
@ -36,6 +36,7 @@ import requests
|
|||||||
from unidiff import PatchSet
|
from unidiff import PatchSet
|
||||||
|
|
||||||
pr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<pr>PR [a-z+-]+\/[0-9]+)')
|
pr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<pr>PR [a-z+-]+\/[0-9]+)')
|
||||||
|
dr_regex = re.compile(r'(\/(\/|\*)|[Cc*!])\s+(?P<dr>DR [0-9]+)')
|
||||||
identifier_regex = re.compile(r'^([a-zA-Z0-9_#].*)')
|
identifier_regex = re.compile(r'^([a-zA-Z0-9_#].*)')
|
||||||
comment_regex = re.compile(r'^\/\*')
|
comment_regex = re.compile(r'^\/\*')
|
||||||
struct_regex = re.compile(r'^(class|struct|union|enum)\s+'
|
struct_regex = re.compile(r'^(class|struct|union|enum)\s+'
|
||||||
@ -142,7 +143,13 @@ def generate_changelog(data, no_functions=False, fill_pr_titles=False):
|
|||||||
if pr not in prs:
|
if pr not in prs:
|
||||||
prs.append(pr)
|
prs.append(pr)
|
||||||
else:
|
else:
|
||||||
break
|
m = dr_regex.search(line.value)
|
||||||
|
if m:
|
||||||
|
dr = m.group('dr')
|
||||||
|
if dr not in prs:
|
||||||
|
prs.append(dr)
|
||||||
|
else:
|
||||||
|
break
|
||||||
|
|
||||||
if fill_pr_titles:
|
if fill_pr_titles:
|
||||||
out += get_pr_titles(prs)
|
out += get_pr_titles(prs)
|
||||||
|
@ -344,6 +344,41 @@ gcc/ChangeLog:
|
|||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
PATCH7 = '''\
|
||||||
|
diff --git a/gcc/testsuite/g++.dg/DRs/dr2237.C b/gcc/testsuite/g++.dg/DRs/dr2237.C
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000000..f3d6d11e61e
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/gcc/testsuite/g++.dg/DRs/dr2237.C
|
||||||
|
@@ -0,0 +1,18 @@
|
||||||
|
+// DR 2237 - Can a template-id name a constructor?
|
||||||
|
+
|
||||||
|
+template<class T>
|
||||||
|
+struct X {
|
||||||
|
+ X<T>(); // { dg-error "expected" "" { target c++20 } }
|
||||||
|
+ X(int); // OK, injected-class-name used
|
||||||
|
+ ~X<T>(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+// ill-formed since DR1435
|
||||||
|
+template<typename T> X<T>::X<T>() {} // { dg-error "names the constructor|as no template constructors" }
|
||||||
|
+template<typename T> X<T>::~X<T>() {} // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
|
||||||
|
+
|
||||||
|
+struct Q {
|
||||||
|
+ // ill-formed since DR1435
|
||||||
|
+ template<typename T> friend X<T>::X<T>(); // { dg-error "names the constructor|as no template constructors" }
|
||||||
|
+ template<typename T> friend X<T>::~X<T>(); // { dg-error "template-id not allowed for destructor" "" { target c++20 } }
|
||||||
|
+};
|
||||||
|
'''
|
||||||
|
|
||||||
|
EXPECTED7 = '''\
|
||||||
|
gcc/testsuite/ChangeLog:
|
||||||
|
|
||||||
|
DR 2237
|
||||||
|
* g++.dg/DRs/dr2237.C: New test.
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
class TestMklog(unittest.TestCase):
|
class TestMklog(unittest.TestCase):
|
||||||
def test_macro_definition(self):
|
def test_macro_definition(self):
|
||||||
changelog = generate_changelog(PATCH1)
|
changelog = generate_changelog(PATCH1)
|
||||||
@ -372,3 +407,7 @@ class TestMklog(unittest.TestCase):
|
|||||||
def test_gty_in_struct(self):
|
def test_gty_in_struct(self):
|
||||||
changelog = generate_changelog(PATCH6, fill_pr_titles=True)
|
changelog = generate_changelog(PATCH6, fill_pr_titles=True)
|
||||||
assert changelog == EXPECTED6
|
assert changelog == EXPECTED6
|
||||||
|
|
||||||
|
def test_dr_detection_in_test_case(self):
|
||||||
|
changelog = generate_changelog(PATCH7)
|
||||||
|
assert changelog == EXPECTED7
|
||||||
|
Loading…
Reference in New Issue
Block a user