[clang] [Clang] Fix assertion when __block is used on global variables in C mode (PR #194856)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 29 09:12:04 PDT 2026


================
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -fblocks -fsyntax-only -verify %s
+
+ at interface MyClass {
+    // expected-warning at -1 {{class 'MyClass' defined without specifying a base class}}
+    // expected-note at -2 {{add a super class to fix this problem}}
+    __block int _myIvar;
----------------
AaronBallman wrote:

The diagnostic we emit elsewhere says this is only allowed on local variables, but this isn't a local variable.

https://github.com/llvm/llvm-project/pull/194856


More information about the cfe-commits mailing list