[clang] 0e87f6f - [clang] Add test for CWG1341 (#67965)

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


Author: Vlad Serebrennikov
Date: 2023-10-02T18:21:49+04:00
New Revision: 0e87f6f8c244f0bedadf031c8848cb78977fc11a

URL: https://github.com/llvm/llvm-project/commit/0e87f6f8c244f0bedadf031c8848cb78977fc11a
DIFF: https://github.com/llvm/llvm-project/commit/0e87f6f8c244f0bedadf031c8848cb78977fc11a.diff

LOG: [clang] Add test for CWG1341 (#67965)

https://cplusplus.github.io/CWG/issues/1341.html
https://wg21.link/p0683r1

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/clang/test/CXX/drs/dr13xx.cpp b/clang/test/CXX/drs/dr13xx.cpp
index feaf523c44fc27c..3510695954e27c1 100644
--- a/clang/test/CXX/drs/dr13xx.cpp
+++ b/clang/test/CXX/drs/dr13xx.cpp
@@ -254,6 +254,23 @@ namespace dr1330 { // dr1330: 4 c++11
 #endif
 }
 
+namespace dr1341 { // dr1341: sup P0683R1
+#if __cplusplus >= 202002L
+int a;
+const int b = 0; // #dr1341-b-decl
+struct S {
+  int x1 : 8 = 42;
+  int x2 : 8 { 42 };
+  int y1 : true ? 8 : a = 42;
+  int y2 : true ? 8 : b = 42;
+  // expected-error at -1            {{cannot assign to variable 'b' with const-qualified type 'const int'}}
+  // expected-note@#dr1341-b-decl {{variable 'b' declared const here}}
+  int y3 : (true ? 8 : b) = 42;
+  int z : 1 || new int { 0 };
+};
+#endif
+}
+
 namespace dr1346 { // dr1346: 3.5
   auto a(1); // expected-error 0-1{{extension}}
   auto b(1, 2); // expected-error {{multiple expressions}} expected-error 0-1{{extension}}

diff  --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 315be0192f73236..23ae365c66032f1 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -7853,7 +7853,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/1341.html">1341</a></td>
     <td>NAD</td>
     <td>Bit-field initializers</td>
-    <td class="none" align="center">Unknown</td>
+    <td class="na" align="center">Superseded by <a href="https://wg21.link/P0683R1">P0683R1</a></td>
   </tr>
   <tr id="1342">
     <td><a href="https://cplusplus.github.io/CWG/issues/1342.html">1342</a></td>


        


More information about the cfe-commits mailing list