diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-13 00:16:40 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2010-07-13 00:16:40 +0000 |
commit | f8681a2a3f558aeefff66513d6a8f6abaa3f3949 (patch) | |
tree | 433a7d2e52982006b51de07643beec9d592d143e /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 6cc1df5d3d52187b86d301555dd1f98240f9ceb6 (diff) | |
download | bcm5719-llvm-f8681a2a3f558aeefff66513d6a8f6abaa3f3949.tar.gz bcm5719-llvm-f8681a2a3f558aeefff66513d6a8f6abaa3f3949.zip |
Instantiate attributes when first building an instantiated
VarDecl.
llvm-svn: 108218
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 3a0e43672d1..2fd35285324 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -396,11 +396,11 @@ Decl *TemplateDeclInstantiator::VisitVarDecl(VarDecl *D) { Owner->makeDeclVisibleInContext(Var); } else { Owner->addDecl(Var); - if (Owner->isFunctionOrMethod()) SemaRef.CurrentInstantiationScope->InstantiatedLocal(D, Var); } - + InstantiateAttrs(D, Var); + // Link instantiations of static data members back to the template from // which they were instantiated. if (Var->isStaticDataMember()) @@ -2591,10 +2591,7 @@ NamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, ParentDC->isFunctionOrMethod()) { // D is a local of some kind. Look into the map of local // declarations to their instantiations. - NamedDecl *ND = - cast<NamedDecl>(CurrentInstantiationScope->getInstantiationOf(D)); - ND->copyAttrs(D); - return ND; + return cast<NamedDecl>(CurrentInstantiationScope->getInstantiationOf(D)); } if (CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(D)) { |