[clang] [clang] Add check for duplicates to make_cxx_dr_status script (PR #67969)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 04:07:09 PDT 2023


https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/67969

While working on #67965, I stumbled upon the fact that `make_cxx_dr_status` script doesn't check for duplicated comment (last comment wins), so I added this check.

It even found another instance of duplicated comment: CWG1223 was marked as CWG1227. I fixed status of the former.

>From 6b488467b6e6b40027e6ba1f5abbeeecbfeeef5b Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: Mon, 2 Oct 2023 14:02:16 +0300
Subject: [PATCH] [clang] Add check for duplicates to make_cxx_dr_status script

---
 clang/test/CXX/drs/dr12xx.cpp | 2 +-
 clang/www/cxx_dr_status.html  | 2 +-
 clang/www/make_cxx_dr_status  | 6 +++++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/clang/test/CXX/drs/dr12xx.cpp b/clang/test/CXX/drs/dr12xx.cpp
index a941366050e1ab5..c23a515ba56cb99 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 { // dr1227: yes open
+namespace dr1223 { // dr1223: 17 drafting
 struct M;
 template <typename T>
 struct V;
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index ee9712e9bab9949..80a80d9940df254 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -7145,7 +7145,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 align="center">Not resolved</td>
+    <td class="unreleased" align="center">Clang 17</td>
   </tr>
   <tr id="1224">
     <td><a href="https://cplusplus.github.io/CWG/issues/1224.html">1224</a></td>
diff --git a/clang/www/make_cxx_dr_status b/clang/www/make_cxx_dr_status
index afb7189c0ececc5..c44a5910d53daeb 100755
--- a/clang/www/make_cxx_dr_status
+++ b/clang/www/make_cxx_dr_status
@@ -39,7 +39,11 @@ def collect_tests():
     test_cpp = os.path.join(dr_test_dir, test_cpp)
     found_any = False;
     for match in re.finditer(status_re, open(test_cpp, 'r').read()):
-      status_map[int(match.group(1))] = match.group(2)
+      dr_number = int(match.group(1))
+      if dr_number in status_map:
+        print("error: Comment for dr{} encountered more than once. Duplicate found in {}".format(dr_number, test_cpp))
+        sys.exit(1)
+      status_map[dr_number] = match.group(2)
       found_any = True
     if not found_any:
       print("warning:%s: no '// dr123: foo' comments in this file" % test_cpp, file=sys.stderr)



More information about the cfe-commits mailing list