From dae69ef4c59fd4b75b956796909592debd7e9bc7 Mon Sep 17 00:00:00 2001 From: John McCall Date: Thu, 20 May 2010 07:05:55 +0000 Subject: [PATCH] Don't try to check jump scopes in invalid functions. Fixes . git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104217 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDecl.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 30eaee423b..af9848fb1a 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -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(dcl)) -- 2.40.0