aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-07-12 21:12:19 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-07-12 21:12:19 +0000
commitcad8d31117800f804ee4f313134162edac8f8813 (patch)
tree7dd23c8cca1171c8ba7c577ecc40cc86b2e09cd8 /lib/Sema/SemaTemplateInstantiateDecl.cpp
parent27cc6331e33efac4020058d2fda36c9060ec5afa (diff)
Copy over attributes to instantiated variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108195 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateDecl.cpp5
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)) {