[clang] [clang] Add a new test for CWG2091 (PR #104573)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 16 02:35:13 PDT 2024


https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/104573

This patch adds a test from https://github.com/llvm/llvm-project/issues/42233, and updated CWG2091 status from `2.7` to `10`.

>From 80e7ad78ba1c1f213ab514edfb81ced1c8363606 Mon Sep 17 00:00:00 2001
From: Vlad Serebrennikov <serebrennikov.vladislav at gmail.com>
Date: Fri, 16 Aug 2024 12:33:04 +0300
Subject: [PATCH] [clang] Add a new test for CWG2091

---
 clang/test/CXX/drs/cwg20xx.cpp | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff --git a/clang/test/CXX/drs/cwg20xx.cpp b/clang/test/CXX/drs/cwg20xx.cpp
index cd2f26360d4021..7509d83e3dea63 100644
--- a/clang/test/CXX/drs/cwg20xx.cpp
+++ b/clang/test/CXX/drs/cwg20xx.cpp
@@ -401,11 +401,34 @@ namespace cwg2083 { // cwg2083: partial
 #endif
 }
 
-namespace cwg2091 { // cwg2091: 2.7
+namespace cwg2091 { // cwg2091: 10
 template<int &> struct X;
 template<int &N> void f(X<N>&);
 int n;
 void g(X<n> &x) { f(x); }
+
+namespace GH42233 {
+enum E { I };
+
+class AA { };
+E EV[1] = {I};
+
+template<class ENUM, const ENUM* const VALUES>
+struct S
+{
+	template< class E, const E* const V>
+		friend AA& operator<<( AA& os, const S<E,V>& e );
+};
+
+int f()
+{
+	S< E, EV > x;
+
+	AA a;
+	a << x;
+	return 0;
+}
+} // namespace GH42233
 } // namespace cwg2091 
 
 namespace cwg2094 { // cwg2094: 5



More information about the cfe-commits mailing list