[clang] [clang][NFC] Actually add the testcase for #195416 (PR #196759)

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Sat May 9 15:47:11 PDT 2026


https://github.com/ojhunt updated https://github.com/llvm/llvm-project/pull/196759

>From 8f976902b6ff4396235da168e6d4646e3996919f Mon Sep 17 00:00:00 2001
From: Oliver Hunt <oliver at apple.com>
Date: Sat, 9 May 2026 14:48:58 -0700
Subject: [PATCH] [clang][NFC] Actually add the testcase for #195416

---
 clang/test/SemaCXX/GH195416.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)
 create mode 100644 clang/test/SemaCXX/GH195416.cpp

diff --git a/clang/test/SemaCXX/GH195416.cpp b/clang/test/SemaCXX/GH195416.cpp
new file mode 100644
index 0000000000000..85ed2961d0ef6
--- /dev/null
+++ b/clang/test/SemaCXX/GH195416.cpp
@@ -0,0 +1,10 @@
+// RUN: %clang_cc1 -std=c++20 -fsyntax-only -verify %s
+
+constexpr void gh195416() {
+  struct U {
+    struct S {};
+    static constexpr S S::bar;
+    // expected-error at -1 {{non-friend class member 'bar' cannot have a qualified name}}
+    // expected-error at -2 {{static data member 'bar' not allowed in local struct 'S'}}
+  };
+}



More information about the cfe-commits mailing list