[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 14:53:23 PDT 2026
https://github.com/ojhunt created https://github.com/llvm/llvm-project/pull/196759
None
>From 2d896aa0e604901608f5a3bd297468ac4d8ffd17 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 | 11 +++++++++++
1 file changed, 11 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..615bd23db1f0f
--- /dev/null
+++ b/clang/test/SemaCXX/GH195416.cpp
@@ -0,0 +1,11 @@
+// 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'}}
+ // expected-error at -3 {{excess elements in struct initializer}}
+ };
+}
More information about the cfe-commits
mailing list