[clang] 89133af - [clang][NFC] Mark CWG2807 as implemented and add a test (#194755)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Apr 29 03:01:03 PDT 2026
Author: Victor Chernyakin
Date: 2026-04-29T03:00:59-07:00
New Revision: 89133afd5e5102ad2504cf890a65224e49c77b5a
URL: https://github.com/llvm/llvm-project/commit/89133afd5e5102ad2504cf890a65224e49c77b5a
DIFF: https://github.com/llvm/llvm-project/commit/89133afd5e5102ad2504cf890a65224e49c77b5a.diff
LOG: [clang][NFC] Mark CWG2807 as implemented and add a test (#194755)
CWG2807 (https://wg21.link/cwg2807): One part of the standard correctly
said destructors can't be `consteval`, but another incorrectly said they
can be.
Clang diagnosed this in 9.0, for some reason started accepting it in
10.0, then went back to diagnosing in 11.0:
https://godbolt.org/z/6sWTYT38M. I've marked it as implemented since
11.0.
The issue that prompted the DR: #65665
Added:
Modified:
clang/test/CXX/drs/cwg28xx.cpp
clang/www/cxx_dr_status.html
Removed:
################################################################################
diff --git a/clang/test/CXX/drs/cwg28xx.cpp b/clang/test/CXX/drs/cwg28xx.cpp
index 536349c3a570d..02c8f30249683 100644
--- a/clang/test/CXX/drs/cwg28xx.cpp
+++ b/clang/test/CXX/drs/cwg28xx.cpp
@@ -6,6 +6,16 @@
// RUN: %clang_cc1 -std=c++23 -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,since-cxx11,cxx11-23,since-cxx20,since-cxx23 %s
// RUN: %clang_cc1 -std=c++2c -fexceptions -fcxx-exceptions -pedantic-errors -verify-directives -verify=expected,since-cxx11,since-cxx20,since-cxx23,since-cxx26 %s
+namespace cwg2807 { // cwg2807: 11
+
+#if __cplusplus >= 202002L
+struct s {
+ consteval ~s() {}
+ // since-cxx20-error at -1 {{destructor cannot be declared consteval}}
+};
+#endif
+
+} // namespace cwg2807
namespace cwg2810 { // cwg2810: 2.7
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index f49163cdd6fc3..9c258049f3edd 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -19458,7 +19458,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td>[<a href="https://wg21.link/class.dtor">class.dtor</a>]</td>
<td>CD7</td>
<td>Destructors declared <TT>consteval</TT></td>
- <td class="unknown" align="center">Unknown</td>
+ <td class="full" align="center">Clang 11</td>
</tr>
<tr class="open" id="2808">
<td><a href="https://cplusplus.github.io/CWG/issues/2808.html">2808</a></td>
More information about the cfe-commits
mailing list