"goto not allowed in block literal">;
def err_return_in_block_expression : Error<
"return not allowed in block expression literal">;
+def err_block_returns_array : Error<
+ "block declared as returning an array">;
def err_ret_local_block : Error<
"returning block that lives on the local stack">;
|| ParamInfo.getTypeObject(0).Kind != DeclaratorChunk::Function) {
QualType T = GetTypeForDeclarator(ParamInfo, CurScope);
+ if (T->isArrayType()) {
+ Diag(ParamInfo.getSourceRange().getBegin(),
+ diag::err_block_returns_array);
+ return;
+ }
+
// The parameter list is optional, if there was none, assume ().
if (!T->isFunctionType())
T = Context.getFunctionType(T, NULL, 0, 0, 0);
return ^{ ^{ i=0; }(); }; // expected-error {{returning block that lives on the local stack}}
return ^{ i=0; }; // expected-error {{returning block that lives on the local stack}}
}
+
+int (*funcptr3[5])(long);
+int sz8 = sizeof(^int (*[5])(long) {return funcptr3;}); // expected-error {{block declared as returning an array}}