diff options
author | Kamlesh Kumar <kamleshbhalui@gmail.com> | 2019-12-20 14:41:46 -0500 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2019-12-20 14:42:37 -0500 |
commit | 304d1304b7bac190b6c9733eb07be284bfc17030 (patch) | |
tree | 9b6d1beaa166dc04929dc0ae2410204c1c4c069b /clang/lib/Sema | |
parent | 14fc20ca62821b5f85582bf76a467d412248c248 (diff) | |
download | bcm5719-llvm-304d1304b7bac190b6c9733eb07be284bfc17030.tar.gz bcm5719-llvm-304d1304b7bac190b6c9733eb07be284bfc17030.zip |
Apply the alignment specifier attribute to anonymous unions and structs.
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 715e8757d43..8f68be716bd 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -5025,6 +5025,8 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS, /*BitWidth=*/nullptr, /*Mutable=*/false, /*InitStyle=*/ICIS_NoInit); Anon->setAccess(AS); + ProcessDeclAttributes(S, Anon, Dc); + if (getLangOpts().CPlusPlus) FieldCollector->Add(cast<FieldDecl>(Anon)); } else { @@ -5038,6 +5040,7 @@ Decl *Sema::BuildAnonymousStructOrUnion(Scope *S, DeclSpec &DS, SC = SC_None; } + assert(DS.getAttributes().empty() && "No attribute expected"); Anon = VarDecl::Create(Context, Owner, DS.getBeginLoc(), Record->getLocation(), /*IdentifierInfo=*/nullptr, Context.getTypeDeclType(Record), TInfo, SC); |