[clang] c46ed70 - [clang][NFC] Mark CWG2780 as implemented and add a test (#195127)
via cfe-commits
cfe-commits at lists.llvm.org
Fri May 1 07:40:48 PDT 2026
Author: Victor Chernyakin
Date: 2026-05-01T07:40:42-07:00
New Revision: c46ed7084ed713392f750d3ca4c832eb88e7d7f3
URL: https://github.com/llvm/llvm-project/commit/c46ed7084ed713392f750d3ca4c832eb88e7d7f3
DIFF: https://github.com/llvm/llvm-project/commit/c46ed7084ed713392f750d3ca4c832eb88e7d7f3.diff
LOG: [clang][NFC] Mark CWG2780 as implemented and add a test (#195127)
[CWG2780](https://wg21.link/cwg2780) allows `reinterpret_cast`ing to a
reference-to-function type. Clang already supports this:
https://godbolt.org/z/c37hsvKnn
Added:
Modified:
clang/test/CXX/drs/cwg27xx.cpp
clang/www/cxx_dr_status.html
Removed:
################################################################################
diff --git a/clang/test/CXX/drs/cwg27xx.cpp b/clang/test/CXX/drs/cwg27xx.cpp
index ae5874ce3c46d..29fe6ca86e773 100644
--- a/clang/test/CXX/drs/cwg27xx.cpp
+++ b/clang/test/CXX/drs/cwg27xx.cpp
@@ -194,6 +194,16 @@ int j = f('a', 2);
#endif
} // namespace cwg2770
+namespace cwg2780 { // cwg2780: 2.7
+
+void f();
+
+void g() {
+ (void)reinterpret_cast<void(&)(int)>(f);
+}
+
+} // namespace cwg2780
+
namespace cwg2789 { // cwg2789: 18
#if __cplusplus >= 202302L
template <typename T = int>
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 9c258049f3edd..3dd13db96b036 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -19269,7 +19269,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
<td>[<a href="https://wg21.link/expr.reinterpret.cast">expr.reinterpret.cast</a>]</td>
<td>CD7</td>
<td><TT>reinterpret_cast</TT> to reference to function types</td>
- <td class="unknown" align="center">Unknown</td>
+ <td class="full" align="center">Clang 2.7</td>
</tr>
<tr class="open" id="2781">
<td><a href="https://cplusplus.github.io/CWG/issues/2781.html">2781</a></td>
More information about the cfe-commits
mailing list