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

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Sun Mar 1 20:01:19 PST 2026


================
@@ -0,0 +1,5 @@
+// RUN: %clang_cc1 -fblocks -fsyntax-only -verify %s
+
+__block int x; // expected-error {{__block attribute not allowed, only allowed on local variables}}
+
+int x[0];
----------------
ojhunt wrote:

New line at the end of this, it might be worth static why this is needed - you also shouldn't need the `[0]` because I think the actual assertion path is from attempting to combine the two declarations.

You should also update the title to indicate this is an assertion

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


More information about the cfe-commits mailing list