[PATCH] D151634: [clang] Add test for CWG253
Vlad Serebrennikov via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jun 2 04:41:26 PDT 2023
Endill updated this revision to Diff 527804.
Endill edited the summary of this revision.
Endill added a comment.
Mark CWG78 as superseded by 2536
Expand CWG253 test
@shafik I think rather than leave 78 out, we better mark it as superseded, so that we don't forget about it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D151634/new/
https://reviews.llvm.org/D151634
Files:
clang/test/CXX/drs/dr0xx.cpp
clang/test/CXX/drs/dr2xx.cpp
clang/www/cxx_dr_status.html
Index: clang/www/cxx_dr_status.html
===================================================================
--- clang/www/cxx_dr_status.html
+++ clang/www/cxx_dr_status.html
@@ -505,7 +505,7 @@
<td><a href="https://cplusplus.github.io/CWG/issues/78.html">78</a></td>
<td>CD1</td>
<td>Section 8.5 paragraph 9 should state it only applies to non-static objects</td>
- <td class="none" align="center">Superseded by <a href="#????">????</a></td>
+ <td class="none" align="center">Superseded by <a href="#2536">2536</a></td>
</tr>
<tr id="79">
<td><a href="https://cplusplus.github.io/CWG/issues/79.html">79</a></td>
@@ -1556,7 +1556,7 @@
<td><a href="https://cplusplus.github.io/CWG/issues/253.html">253</a></td>
<td>C++17</td>
<td>Why must empty or fully-initialized const objects be initialized?</td>
- <td class="none" align="center">Unknown</td>
+ <td class="full" align="center">Clang 3.9</td>
</tr>
<tr id="254">
<td><a href="https://cplusplus.github.io/CWG/issues/254.html">254</a></td>
@@ -3021,7 +3021,7 @@
<td><a href="https://cplusplus.github.io/CWG/issues/497.html">497</a></td>
<td>CD1</td>
<td>Missing required initialization in example</td>
- <td class="none" align="center">Superseded by <a href="#253">253</a></td>
+ <td class="full" align="center">Superseded by <a href="#253">253</a></td>
</tr>
<tr class="open" id="498">
<td><a href="https://cplusplus.github.io/CWG/issues/498.html">498</a></td>
Index: clang/test/CXX/drs/dr2xx.cpp
===================================================================
--- clang/test/CXX/drs/dr2xx.cpp
+++ clang/test/CXX/drs/dr2xx.cpp
@@ -4,6 +4,7 @@
// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
+// RUN: %clang_cc1 -std=c++2b %s -verify -fexceptions -fcxx-exceptions -pedantic-errors
// PR13819 -- __SIZE_TYPE__ is incompatible.
typedef __SIZE_TYPE__ size_t; // expected-error 0-1 {{extension}}
@@ -682,6 +683,24 @@
G::~G() {}
}
+namespace dr253 { // dr253: 3.9
+struct X {};
+struct Y {
+ X x;
+};
+
+struct Z {
+ operator int() const { return 0; }
+};
+
+void f() {
+ const X x1;
+ const X x2 = { };
+ const Z z1;
+ const Z z2 = { };
+}
+} // namespace dr253
+
namespace dr254 { // dr254: yes
template<typename T> struct A {
typedef typename T::type type; // ok even if this is a typedef-name, because
Index: clang/test/CXX/drs/dr0xx.cpp
===================================================================
--- clang/test/CXX/drs/dr0xx.cpp
+++ clang/test/CXX/drs/dr0xx.cpp
@@ -4,6 +4,7 @@
// RUN: %clang_cc1 -std=c++17 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
// RUN: %clang_cc1 -std=c++20 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
// RUN: %clang_cc1 -std=c++23 %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
+// RUN: %clang_cc1 -std=c++2c %s -verify -fexceptions -fcxx-exceptions -pedantic-errors -triple %itanium_abi_triple
namespace dr1 { // dr1: no
namespace X { extern "C" void dr1_f(int a = 1); }
@@ -1018,7 +1019,7 @@
};
}
-namespace dr78 { // dr78: sup ????
+namespace dr78 { // dr78: sup 2536
// Under DR78, this is valid, because 'k' has static storage duration, so is
// zero-initialized.
const int k; // expected-error {{default initialization of an object of const}}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151634.527804.patch
Type: text/x-patch
Size: 3626 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230602/134f0d88/attachment-0001.bin>
More information about the cfe-commits
mailing list