[clang] [clang][NFC] Mark CWG2810 as implemented and add a test (PR #194683)

Victor Chernyakin via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 28 13:03:13 PDT 2026


https://github.com/localspook updated https://github.com/llvm/llvm-project/pull/194683

>From 7b668d18c63d5c75a269e9aca1df91c4a2856529 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin <chernyakin.victor.j at outlook.com>
Date: Tue, 28 Apr 2026 10:12:25 -0700
Subject: [PATCH 1/2] [clang][NFC] Mark CWG2810 as implemented and add a test

---
 clang/test/CXX/drs/cwg28xx.cpp | 10 ++++++++++
 clang/www/cxx_dr_status.html   |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/clang/test/CXX/drs/cwg28xx.cpp b/clang/test/CXX/drs/cwg28xx.cpp
index 9ec3cc5a1a346..c539a09ebbdf9 100644
--- a/clang/test/CXX/drs/cwg28xx.cpp
+++ b/clang/test/CXX/drs/cwg28xx.cpp
@@ -7,6 +7,16 @@
 // 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 cwg2810 { // cwg2810: yes
+
+template <typename>
+void f() {
+  int i = 1.5;
+  // expected-warning at -1 {{implicit conversion from 'double' to 'int' changes value from 1.5 to 1}}
+}
+
+} // namespace cwg2810
+
 int main() {} // required for cwg2811
 
 namespace cwg2811 { // cwg2811: 3.5
diff --git a/clang/www/cxx_dr_status.html b/clang/www/cxx_dr_status.html
index 9c3ff1aac4b66..95a0b0c803a73 100755
--- a/clang/www/cxx_dr_status.html
+++ b/clang/www/cxx_dr_status.html
@@ -19479,7 +19479,7 @@ <h2 id="cxxdr">C++ defect report implementation status</h2>
     <td>[<a href="https://wg21.link/temp.res.general">temp.res.general</a>]</td>
     <td>CD7</td>
     <td>Requiring the absence of diagnostics for templates</td>
-    <td class="unknown" align="center">Unknown</td>
+    <td class="full" align="center">Yes</td>
   </tr>
   <tr id="2811">
     <td><a href="https://cplusplus.github.io/CWG/issues/2811.html">2811</a></td>

>From 55f83aef1caf69c5cd98171485816beb94939963 Mon Sep 17 00:00:00 2001
From: Victor Chernyakin <chernyakin.victor.j at outlook.com>
Date: Tue, 28 Apr 2026 13:02:26 -0700
Subject: [PATCH 2/2] Adjust test

---
 clang/test/CXX/drs/cwg28xx.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clang/test/CXX/drs/cwg28xx.cpp b/clang/test/CXX/drs/cwg28xx.cpp
index c539a09ebbdf9..81855b71f146f 100644
--- a/clang/test/CXX/drs/cwg28xx.cpp
+++ b/clang/test/CXX/drs/cwg28xx.cpp
@@ -11,8 +11,8 @@ namespace cwg2810 { // cwg2810: yes
 
 template <typename>
 void f() {
-  int i = 1.5;
-  // expected-warning at -1 {{implicit conversion from 'double' to 'int' changes value from 1.5 to 1}}
+  0xC0FFEE;
+  // expected-warning at -1 {{expression result unused}}
 }
 
 } // namespace cwg2810



More information about the cfe-commits mailing list