Don't try to check jump scopes in invalid functions. Fixes
<rdar://problem/7995494>.
llvm-svn: 104217
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 30eaee4..af9848f 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -4693,7 +4693,9 @@
// 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))