From 00b465747138ec5c00e1d7568d2eb88c6db6042d Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 25 Jan 2012 03:53:04 +0000 Subject: [PATCH] In TreeTransform::TransformBlockExpr, call ActOnBlockError for errors, patch by Dmitri Gribenko. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148915 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/TreeTransform.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Sema/TreeTransform.h b/lib/Sema/TreeTransform.h index 716d9b3f32..2ddba4710f 100644 --- a/lib/Sema/TreeTransform.h +++ b/lib/Sema/TreeTransform.h @@ -8125,8 +8125,10 @@ TreeTransform::TransformBlockExpr(BlockExpr *E) { if (getDerived().TransformFunctionTypeParams(E->getCaretLocation(), oldBlock->param_begin(), oldBlock->param_size(), - 0, paramTypes, ¶ms)) + 0, paramTypes, ¶ms)) { + getSema().ActOnBlockError(E->getCaretLocation(), /*Scope=*/0); return ExprError(); + } const FunctionType *exprFunctionType = E->getFunctionType(); QualType exprResultType = exprFunctionType->getResultType(); @@ -8147,6 +8149,7 @@ TreeTransform::TransformBlockExpr(BlockExpr *E) { getSema().Diag(E->getCaretLocation(), diag::err_object_cannot_be_passed_returned_by_value) << 0 << blockScope->ReturnType; + getSema().ActOnBlockError(E->getCaretLocation(), /*Scope=*/0); return ExprError(); } @@ -8171,8 +8174,10 @@ TreeTransform::TransformBlockExpr(BlockExpr *E) { // Transform the body StmtResult body = getDerived().TransformStmt(E->getBody()); - if (body.isInvalid()) + if (body.isInvalid()) { + getSema().ActOnBlockError(E->getCaretLocation(), /*Scope=*/0); return ExprError(); + } #ifndef NDEBUG // In builds with assertions, make sure that we captured everything we -- 2.40.0