[clang] [Clang] support storage-class specifiers in C23 compound literals (PR #212559)
Akira Hatanaka via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 3 19:00:54 PDT 2026
================
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -std=c23 -fobjc-arc -verify %s
+
+typedef struct {
+ id a;
+} S;
+
+void test1(void) {
+ (void)(thread_local static __unsafe_unretained id){0};
+ (void)(thread_local static id){0}; // expected-error {{thread-local variable has non-trivial ownership: type is '__strong id'}}
----------------
ahatanak wrote:
Could you test `(void)(thread_local static Class){0}` too (no diagnostics expected)?
https://github.com/llvm/llvm-project/pull/212559
More information about the cfe-commits
mailing list