return ExprError();
}
- if (VD->getType()->isArrayType() && !VD->hasAttr<BlocksAttr>()) {
+ if (VD->getType()->isArrayType()) {
Diag(Loc, diag::err_ref_array_type);
Diag(D->getLocation(), diag::note_declared_at);
return ExprError();
+++ /dev/null
-// RUN: %clang_cc1 %s -fsyntax-only -verify -fblocks
-
-int printf(const char *, ...);
-
-int main(int argc, char **argv) {
- __block void(*bobTheFunction)(void);
- __block void(^bobTheBlock)(void);
-
- bobTheBlock = ^{;};
-
- __block int JJJJ;
- __attribute__((__blocks__(byref))) int III;
-
- int (^XXX)(void) = ^{ return III+JJJJ; };
-
- // rdar 7671883
- __block char array[10] = {'a', 'b', 'c', 'd'};
- char (^ch)() = ^{ array[1] = 'X'; return array[5]; };
- ch();
-
- return 0;
-}
// radr://7438948
void test21() {
int a[7]; // expected-note {{declared at}}
+ __block int b[10]; // expected-note {{declared at}}
a[1] = 1;
^{
(void)a[1]; // expected-error {{cannot refer to declaration with an array type inside block}}
+ (void)b[1]; // expected-error {{cannot refer to declaration with an array type inside block}}
}();
}