"block declared 'noreturn' should not return">;
def err_block_on_nonlocal : Error<
"__block attribute not allowed, only allowed on local variables">;
+def err_block_on_vm : Error<
+ "__block attribute not allowed on declaration with a variably modified type">;
def err_shufflevector_non_vector : Error<
"first two arguments to __builtin_shufflevector must be vectors">;
return NewVD->setInvalidDecl();
}
+ if (isVM && NewVD->hasAttr<BlocksAttr>()) {
+ Diag(NewVD->getLocation(), diag::err_block_on_vm);
+ return NewVD->setInvalidDecl();
+ }
+
if (PrevDecl) {
Redeclaration = true;
MergeVarDecl(NewVD, PrevDecl);
__block int test16i; // expected-error {{__block attribute not allowed, only allowed on local variables}}
void test16(__block int i) { // expected-error {{__block attribute not allowed, only allowed on local variables}}
+ int size = 5;
extern __block double extern_var; // expected-error {{__block attribute not allowed, only allowed on local variables}}
static __block char * pch; // expected-error {{__block attribute not allowed, only allowed on local variables}}
+ __block int a[size]; // expected-error {{__block attribute not allowed on declaration with a variably modified type}}
+ __block int (*ap)[size]; // expected-error {{__block attribute not allowed on declaration with a variably modified type}}
}
-