diff options
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 5778a827fc..3a0e43672d 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -2591,7 +2591,10 @@ 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. - return cast<NamedDecl>(CurrentInstantiationScope->getInstantiationOf(D)); + NamedDecl *ND = + cast<NamedDecl>(CurrentInstantiationScope->getInstantiationOf(D)); + ND->copyAttrs(D); + return ND; } if (CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(D)) { |