diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2014-10-15 16:58:18 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2014-10-15 16:58:18 +0000 |
commit | 822389da583d9d67f46e84552ecb580c49abcda7 (patch) | |
tree | 4ff9eec486108f76d9506774cd2c2ace9781ec47 /lib/Sema/SemaTemplateInstantiateDecl.cpp | |
parent | 51847c2025e5e5d30ac45178bf22e44e09e591dc (diff) |
Adding attributes to the IndirectFieldDecl that we generate for anonymous struct/union fields. This fixes PR20930.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219807 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index 274105d532..ec8c08ddf5 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -653,11 +653,12 @@ Decl *TemplateDeclInstantiator::VisitIndirectFieldDecl(IndirectFieldDecl *D) { } QualType T = cast<FieldDecl>(NamedChain[i-1])->getType(); - IndirectFieldDecl* IndirectField - = IndirectFieldDecl::Create(SemaRef.Context, Owner, D->getLocation(), - D->getIdentifier(), T, - NamedChain, D->getChainingSize()); + IndirectFieldDecl *IndirectField = IndirectFieldDecl::Create( + SemaRef.Context, Owner, D->getLocation(), D->getIdentifier(), T, + NamedChain, D->getChainingSize()); + for (const auto *Attr : D->attrs())
+ IndirectField->addAttr(Attr->clone(SemaRef.Context));
IndirectField->setImplicit(D->isImplicit()); IndirectField->setAccess(D->getAccess()); |