diff options
author | Douglas Gregor <dgregor@apple.com> | 2012-02-13 22:00:16 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2012-02-13 22:00:16 +0000 |
commit | dfca6f53ab97d28d43e3fa2564209df08f3d282c (patch) | |
tree | 1e1a5459162a72d9f5d1306def0035c13cae51ec /lib/Sema/SemaTemplateInstantiate.cpp | |
parent | 07e5288c6532c8a61278fab4e0ae058ec81a0f5c (diff) |
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
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiate.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiate.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiate.cpp b/lib/Sema/SemaTemplateInstantiate.cpp index bd5a1ed3d0..073d64407a 100644 --- a/lib/Sema/SemaTemplateInstantiate.cpp +++ b/lib/Sema/SemaTemplateInstantiate.cpp @@ -732,6 +732,14 @@ namespace { /// this declaration. Decl *TransformDecl(SourceLocation Loc, Decl *D); + void transformAttrs(Decl *Old, Decl *New) { + SemaRef.InstantiateAttrs(TemplateArgs, Old, New); + } + + void transformedLocalDecl(Decl *Old, Decl *New) { + SemaRef.CurrentInstantiationScope->InstantiatedLocal(Old, New); + } + /// \brief Transform the definition of the given declaration by /// instantiating it. Decl *TransformDefinition(SourceLocation Loc, Decl *D); |