diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-05-14 21:44:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-05-14 21:44:34 +0000 |
commit | 48dd19b19ddb9e105f8cf0bf6f0732ca4e6a385b (patch) | |
tree | 48beecdf0187053b9d18bb56cd95d8b8366d1ff1 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 304376651e85a6f84055ffa0b42517f8631e7f6b (diff) |
Introduce a stack of instantiation scopes that are used to store the mapping from variable declarations that occur within templates to their instantiated counterparts
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71799 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 6ae6b2240b..19aaafbcc6 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -279,6 +279,8 @@ Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D) { if (D->getKind() != Decl::CXXMethod) return 0; + Sema::LocalInstantiationScope Scope(SemaRef); + llvm::SmallVector<ParmVarDecl *, 16> Params; QualType T = InstantiateFunctionType(D, Params); if (T.isNull()) @@ -320,6 +322,8 @@ Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D) { } Decl *TemplateDeclInstantiator::VisitCXXConstructorDecl(CXXConstructorDecl *D) { + Sema::LocalInstantiationScope Scope(SemaRef); + llvm::SmallVector<ParmVarDecl *, 16> Params; QualType T = InstantiateFunctionType(D, Params); if (T.isNull()) @@ -363,6 +367,8 @@ Decl *TemplateDeclInstantiator::VisitCXXConstructorDecl(CXXConstructorDecl *D) { } Decl *TemplateDeclInstantiator::VisitCXXDestructorDecl(CXXDestructorDecl *D) { + Sema::LocalInstantiationScope Scope(SemaRef); + llvm::SmallVector<ParmVarDecl *, 16> Params; QualType T = InstantiateFunctionType(D, Params); if (T.isNull()) @@ -391,6 +397,8 @@ Decl *TemplateDeclInstantiator::VisitCXXDestructorDecl(CXXDestructorDecl *D) { } Decl *TemplateDeclInstantiator::VisitCXXConversionDecl(CXXConversionDecl *D) { + Sema::LocalInstantiationScope Scope(SemaRef); + llvm::SmallVector<ParmVarDecl *, 16> Params; QualType T = InstantiateFunctionType(D, Params); if (T.isNull()) @@ -452,6 +460,7 @@ ParmVarDecl *TemplateDeclInstantiator::VisitParmVarDecl(ParmVarDecl *D) { // Note: we don't try to instantiate function parameters until after // we've instantiated the function's type. Therefore, we don't have // to check for 'void' parameter types here. + SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Param); return Param; } |