[clang] [clang] Add test for CWG1341 (PR #67965)

via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 2 03:19:48 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

<details>
<summary>Changes</summary>

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

---
Full diff: https://github.com/llvm/llvm-project/pull/67965.diff


2 Files Affected:

- (modified) clang/test/CXX/drs/dr13xx.cpp (+17) 
- (modified) clang/www/cxx_dr_status.html (+1-1) 


``````````diff
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 ee9712e9bab9949..6b351a3eb72f3d1 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>

``````````

</details>


https://github.com/llvm/llvm-project/pull/67965


More information about the cfe-commits mailing list