diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2012-08-08 21:08:34 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2012-08-08 21:08:34 +0000 |
commit | 0415f3e13888d6c72f0d0463c2d3604b3b746985 (patch) | |
tree | 87174a6b8769daa8ec82a7b0647edccdfbe6ad9d /clang/lib/Sema/SemaTemplate.cpp | |
parent | b1886eb6043173e8f44fe5d4b8b30cb6290c582f (diff) | |
download | bcm5719-llvm-0415f3e13888d6c72f0d0463c2d3604b3b746985.tar.gz bcm5719-llvm-0415f3e13888d6c72f0d0463c2d3604b3b746985.zip |
Don't add attributes for "#pragma pack" and friends to tag declarations which
are not definitions. This follows the behavior of both gcc and earlier
versions of clang. Regression from r156531. <rdar://problem/12048621>.
llvm-svn: 161523
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index cbfa1ba42e0..c8e45016671 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -1064,8 +1064,10 @@ Sema::CheckClassTemplate(Scope *S, unsigned TagSpec, TagUseKind TUK, // Add alignment attributes if necessary; these attributes are checked when // the ASTContext lays out the structure. - AddAlignmentAttributesForRecord(NewClass); - AddMsStructLayoutForRecord(NewClass); + if (TUK == TUK_Definition) { + AddAlignmentAttributesForRecord(NewClass); + AddMsStructLayoutForRecord(NewClass); + } ClassTemplateDecl *NewTemplate = ClassTemplateDecl::Create(Context, SemanticContext, NameLoc, |