From dfca6f53ab97d28d43e3fa2564209df08f3d282c Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 13 Feb 2012 22:00:16 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150417 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaTemplate.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/Sema/SemaTemplate.cpp') diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index af2c6efdff..17bdd69ec2 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -6842,6 +6842,11 @@ namespace { this->Loc = Loc; this->Entity = Entity; } + + ExprResult TransformLambdaExpr(LambdaExpr *E) { + // Lambdas never need to be transformed. + return E; + } }; } -- cgit v1.2.3-18-g5258