[cfe-commits] r147595 - in /cfe/trunk: include/clang/AST/TypeLoc.h include/clang/Sema/ScopeInfo.h include/clang/Sema/Sema.h lib/Parse/ParseExprCXX.cpp lib/Sema/Sema.cpp lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclCXX.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaExprCXX.cpp test/Parser/objcxx0x-lambda-expressions.mm
Richard Smith
richard at metafoo.co.uk
Thu Jan 5 09:55:14 PST 2012
On Thu, January 5, 2012 03:35, Eli Friedman wrote:
> Author: efriedma
> Date: Wed Jan 4 21:35:19 2012
> New Revision: 147595
>
>
> URL: http://llvm.org/viewvc/llvm-project?rev=147595&view=rev
> Log:
> More lambda work. Tweak the Sema interface slightly. Start adding the pieces
> to build the lambda class and its call operator. Create an actual scope for
> the lambda body.
>
> Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=14
> 7595&r1=147594&r2=147595&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
> +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Wed Jan 4 21:35:19 2012
> @@ -4778,20 +4778,68 @@
> // Lambdas.
> //===----------------------------------------------------------------------===
> //
>
>
> -void Sema::ActOnLambdaStart(SourceLocation StartLoc, Scope *CurScope) {
> - // FIXME: Add lambda-scope
> - // FIXME: PushDeclContext
> +void Sema::ActOnStartOfLambdaDefinition(LambdaIntroducer &Intro,
> + Declarator &ParamInfo,
> + Scope *CurScope) {
> + DeclContext *DC = CurContext;
> + while (!(DC->isFunctionOrMethod() || DC->isRecord() || DC->isNamespace()))
> + DC = DC->getParent();
isNamespace() should presumably be isFileContext() here: this crashes on
global-scope lambdas.
More information about the cfe-commits
mailing list