Don't try to check jump scopes in invalid functions. Fixes

<rdar://problem/7995494>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104217 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
John McCall 2010-05-20 07:05:55 +00:00
Родитель cb359df81b
Коммит dae69ef4c5
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -4693,7 +4693,9 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg,
// Verify that that gotos and switch cases don't jump into scopes illegally.
// Verify that that gotos and switch cases don't jump into scopes illegally.
if (FunctionNeedsScopeChecking() && !hasAnyErrorsInThisFunction())
if (FunctionNeedsScopeChecking() &&
!FD->isInvalidDecl() &&
!hasAnyErrorsInThisFunction())
DiagnoseInvalidJumps(Body);
if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(dcl))