[clang] 1a3a1d9 - [clang] Add check for duplicates to make_cxx_dr_status script (#67969)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 07:34:43 PDT 2023


Author: Vlad Serebrennikov
Date: 2023-10-02T18:34:37+04:00
New Revision: 1a3a1d9674df00451ab6f7153b78d5f60abcd3c9

URL: https://github.com/llvm/llvm-project/commit/1a3a1d9674df00451ab6f7153b78d5f60abcd3c9
DIFF: https://github.com/llvm/llvm-project/commit/1a3a1d9674df00451ab6f7153b78d5f60abcd3c9.diff

LOG: [clang] Add check for duplicates to make_cxx_dr_status script (#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.

Added: 
    

Modified: 
    clang/test/CXX/drs/dr12xx.cpp
    clang/www/cxx_dr_status.html
    clang/www/make_cxx_dr_status

Removed: 
    


################################################################################
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 23ae365c66032f1..2617a2e6f7a86be 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