[clang] [clang] Add test for CWG1606 (PR #87274)

Yuri Istomin via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 1 12:07:30 PDT 2024


https://github.com/NekoCdr created https://github.com/llvm/llvm-project/pull/87274

https://cplusplus.github.io/CWG/issues/1606.html

>From 1dfb9414a28f99024a8abe36b0b10a4d91eae573 Mon Sep 17 00:00:00 2001
From: Yuri Istomin <nekocoder.pw at gmail.com>
Date: Mon, 1 Apr 2024 22:02:42 +0300
Subject: [PATCH 1/2] [clang] Add test for CWG1606

---
 clang/test/CXX/drs/dr16xx.cpp | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/clang/test/CXX/drs/dr16xx.cpp b/clang/test/CXX/drs/dr16xx.cpp
index 766c90d3bc7bda..cf05cc2291e6ff 100644
--- a/clang/test/CXX/drs/dr16xx.cpp
+++ b/clang/test/CXX/drs/dr16xx.cpp
@@ -35,6 +35,17 @@ void g() {
 }
 } // namespace dr1601
 
+namespace dr1606 { // dr1606: 3.1
+#if __cplusplus >= 201103L
+  std::size_t test() {
+    int i = 1;
+    int j = 1;
+    auto f = [=]{ return i + j;};
+    return sizeof(f);
+  }
+#endif
+} // namespace dr1606
+
 namespace dr1611 { // dr1611: dup 1658
   struct A { A(int); };
   struct B : virtual A { virtual void f() = 0; };

>From fdffb31e1f960d51b840398950e3758f7c5a284f Mon Sep 17 00:00:00 2001
From: Yuri Istomin <nekocoder.pw at gmail.com>
Date: Mon, 1 Apr 2024 22:03:12 +0300
Subject: [PATCH 2/2] Update DR status page

---
 clang/www/cxx_dr_status.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index c20a5d021e9d95..5e1e03dec1d484 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -9444,7 +9444,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td><a href="https://cplusplus.github.io/CWG/issues/1606.html">1606</a></td>
     <td>NAD</td>
     <td><TT>sizeof</TT> closure class</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Clang 3.1</td>
   </tr>
   <tr id="1607">
     <td><a href="https://cplusplus.github.io/CWG/issues/1607.html">1607</a></td>



More information about the cfe-commits mailing list