summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorFaisal Vali <faisalv@yahoo.com>2013-12-08 15:00:29 +0000
committerFaisal Vali <faisalv@yahoo.com>2013-12-08 15:00:29 +0000
commit5ab61b09be18c22b10e0e45e871094d60d50c8f0 (patch)
treead9e913a5d7c07fd614fdac0d536892bd216d049 /clang/lib
parent21baded28cb773e51f7b033a20537cd06e32f380 (diff)
downloadbcm5719-llvm-5ab61b09be18c22b10e0e45e871094d60d50c8f0.tar.gz
bcm5719-llvm-5ab61b09be18c22b10e0e45e871094d60d50c8f0.zip
Fix an assertion introduced by my previous refactoring.
Add back the test that was triggering the assertion (which I removed mistakenly thinking it was triggering just a warning and not an assertion). My error was brought to my attention by Rafael (Thanks!). llvm-svn: 196721
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaLambda.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaLambda.cpp b/clang/lib/Sema/SemaLambda.cpp
index 0719f4156f3..5ed4c6153d3 100644
--- a/clang/lib/Sema/SemaLambda.cpp
+++ b/clang/lib/Sema/SemaLambda.cpp
@@ -181,12 +181,10 @@ Optional<unsigned> clang::getStackIndexOfNearestEnclosingCaptureCapableLambda(
return FailDistance;
const unsigned IndexOfCaptureReadyLambda = OptionalStackIndex.getValue();
- assert(
- ((IndexOfCaptureReadyLambda != (FunctionScopes.size() - 1)) ||
- (S.getCurGenericLambda() && S.getCurGenericLambda()->ImpCaptureStyle !=
- sema::LambdaScopeInfo::ImpCap_None)) &&
- "The capture ready lambda for a potential capture can only be the "
- "current lambda if it is a generic lambda with an implicit capture");
+ assert(((IndexOfCaptureReadyLambda != (FunctionScopes.size() - 1)) ||
+ S.getCurGenericLambda()) &&
+ "The capture ready lambda for a potential capture can only be the "
+ "current lambda if it is a generic lambda with an implicit capture");
const sema::LambdaScopeInfo *const CaptureReadyLambdaLSI =
cast<sema::LambdaScopeInfo>(FunctionScopes[IndexOfCaptureReadyLambda]);
OpenPOWER on IntegriCloud