diff options
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index f2f8ae5797c..045fa180e65 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -4726,6 +4726,12 @@ void Sema::ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) { || 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); |