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 | 260995b86b8895ac22da92415cea9690c6905291 (patch) | |
tree | cdd943a30d997fb2db61e84b853b7a7bd4ee92b3 /clang/lib/AST/ASTImporter.cpp | |
parent | 72d03bee6497a80e70ffbf43a6e28cd55bf3527b (diff) | |
download | bcm5719-llvm-260995b86b8895ac22da92415cea9690c6905291.tar.gz bcm5719-llvm-260995b86b8895ac22da92415cea9690c6905291.zip |
Adding attributes to the IndirectFieldDecl that we generate for anonymous struct/union fields. This fixes PR20930.
llvm-svn: 219807
Diffstat (limited to 'clang/lib/AST/ASTImporter.cpp')
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index ca7ab63c96f..1627e477f95 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/lib/AST/ASTImporter.cpp @@ -2958,9 +2958,12 @@ Decl *ASTNodeImporter::VisitIndirectFieldDecl(IndirectFieldDecl *D) { } IndirectFieldDecl *ToIndirectField = IndirectFieldDecl::Create( - Importer.getToContext(), DC, - Loc, Name.getAsIdentifierInfo(), T, - NamedChain, D->getChainingSize()); + Importer.getToContext(), DC, Loc, Name.getAsIdentifierInfo(), T, + NamedChain, D->getChainingSize()); + + for (const auto *Attr : D->attrs()) + ToIndirectField->addAttr(Attr->clone(Importer.getToContext())); + ToIndirectField->setAccess(D->getAccess()); ToIndirectField->setLexicalDeclContext(LexicalDC); Importer.Imported(D, ToIndirectField); |