aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaLambda.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2012-09-18 21:11:30 +0000
committerEli Friedman <eli.friedman@gmail.com>2012-09-18 21:11:30 +0000
commit9cd5b24315aea4bc58bac03cfb4874e076b013b8 (patch)
treef59e1975534364daa8ef5d6c7e5f00c580845bde /lib/Sema/SemaLambda.cpp
parent3ba02522c8277e578a234f4f8fb042a21ceb853a (diff)
Add an extra check for invalid decls in the lambda semantic analysis to avoid a crash. PR13860.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164168 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaLambda.cpp')
-rw-r--r--lib/Sema/SemaLambda.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp
index 75ea5368f8..7cbfc364f6 100644
--- a/lib/Sema/SemaLambda.cpp
+++ b/lib/Sema/SemaLambda.cpp
@@ -527,6 +527,10 @@ void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
continue;
}
+ // Ignore invalid decls; they'll just confuse the code later.
+ if (Var->isInvalidDecl())
+ continue;
+
if (!Var->hasLocalStorage()) {
Diag(C->Loc, diag::err_capture_non_automatic_variable) << C->Id;
Diag(Var->getLocation(), diag::note_previous_decl) << C->Id;