[cfe-commits] r150417 - in /cfe/trunk: include/clang/AST/ExprCXX.h include/clang/Sema/Sema.h lib/AST/ExprCXX.cpp lib/AST/StmtPrinter.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaLambda.cpp lib/Sema/SemaTemplate.cpp lib/Sema/SemaTemplateDeduction.cpp li

Douglas Gregor dgregor at apple.com
Mon Feb 13 21:26:44 PST 2012


On Feb 13, 2012, at 7:38 PM, Eli Friedman wrote:

> On Mon, Feb 13, 2012 at 2:00 PM, Douglas Gregor <dgregor at apple.com> wrote:
>> Author: dgregor
>> Date: Mon Feb 13 16:00:16 2012
>> New Revision: 150417
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=150417&view=rev
>> Log:
>> Introduce support for template instantiation of lambda
>> expressions. This is mostly a simple refact, splitting the main "start
>> a lambda expression" function into smaller chunks that are driven
>> either from the parser (Sema::ActOnLambdaExpr) or during AST
>> transformation (TreeTransform::TransformLambdaExpr). A few minor
>> interesting points:
>> 
>>  - Added new entry points for TreeTransform, so that we can
>>  explicitly establish the link between the lambda closure type in the
>>  template and the lambda closure type in the instantiation.
>>  - Added a bit into LambdaExpr specifying whether it had an explicit
>>  result type or not. We should have had this anyway.
>> 
>> This code is 'lightly' tested.
> 
> Tried testing a bit; hjere's a testcase which isn't working:
> 
> template<int x> void f(int y) { [y]{ return [=]{ return x+y; }; }()(); }
> void g() { f<10>(10); }


Seems fine with r150347.

	- Doug



More information about the cfe-commits mailing list