зеркало из https://github.com/microsoft/clang-1.git
make block bodies handle undefined labels just like functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125799 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
d8df5b65fc
Коммит
e476bdce8c
|
@ -8866,13 +8866,10 @@ ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc,
|
|||
if (getCurFunction()->NeedsScopeChecking() && !hasAnyErrorsInThisFunction())
|
||||
DiagnoseInvalidJumps(cast<CompoundStmt>(Body));
|
||||
|
||||
BSI->TheDecl->setBody(cast<CompoundStmt>(Body));
|
||||
|
||||
// Check goto/label use.
|
||||
if (BSI->checkLabelUse(0, *this)) {
|
||||
PopFunctionOrBlockScope();
|
||||
return ExprError();
|
||||
}
|
||||
BSI->checkLabelUse(Body, *this);
|
||||
|
||||
BSI->TheDecl->setBody(cast<CompoundStmt>(Body));
|
||||
|
||||
BlockExpr *Result = new (Context) BlockExpr(BSI->TheDecl, BlockTy);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче