diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-01-04 02:40:39 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-01-04 02:40:39 +0000 |
commit | dc3b723d35067e5d13474247b94a10c869cc7e58 (patch) | |
tree | ff854188e2a842098addbad74dd52dde0987ac30 /lib/Sema/SemaExprCXX.cpp | |
parent | 4cd55b04e37d2c2c078be8d55c767213af8cc4ef (diff) |
Stub out the Sema interface for lambda expressions, and change the parser to use it. Unconditionally error on lambda expressions because they don't work in any meaningful way yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | lib/Sema/SemaExprCXX.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp index eaa330b183..67e1c2fb09 100644 --- a/lib/Sema/SemaExprCXX.cpp +++ b/lib/Sema/SemaExprCXX.cpp @@ -4774,3 +4774,38 @@ Sema::CheckMicrosoftIfExistsSymbol(Scope *S, SourceLocation KeywordLoc, return CheckMicrosoftIfExistsSymbol(S, SS, TargetNameInfo); } +//===----------------------------------------------------------------------===// +// Lambdas. +//===----------------------------------------------------------------------===// + +void Sema::ActOnLambdaStart(SourceLocation StartLoc, Scope *CurScope) { + // FIXME: Add lambda-scope + // FIXME: Build lambda-decl + // FIXME: PushDeclContext + + // Enter a new evaluation context to insulate the block from any + // cleanups from the enclosing full-expression. + PushExpressionEvaluationContext(PotentiallyEvaluated); +} + +void Sema::ActOnLambdaArguments(Declarator &ParamInfo, Scope *CurScope) { + // FIXME: Implement +} + +void Sema::ActOnLambdaError(SourceLocation StartLoc, Scope *CurScope) { + // Leave the expression-evaluation context. + DiscardCleanupsInEvaluationContext(); + PopExpressionEvaluationContext(); + + // Leave the context of the lambda. + // FIXME: PopDeclContext + // FIXME: Pop lambda-scope +} + +ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, + Stmt *Body, Scope *CurScope) { + // FIXME: Implement + Diag(StartLoc, diag::err_lambda_unsupported); + ActOnLambdaError(StartLoc, CurScope); + return ExprError(); +} |