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 | 2016c8c4a2ebf528c54c42045bc6a30ae590147c (patch) | |
tree | 4b9cba99a858d6031f83063ed8ee14882157bdb2 /lib/Sema/SemaDecl.cpp | |
parent | 871ee56e8003b8ce6f0658351ca051db504d9dc4 (diff) |
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>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161523 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index 869fedb00c..2b38718db9 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -8807,9 +8807,10 @@ CreateNewDecl: // many points during the parsing of a struct declaration (because // the #pragma tokens are effectively skipped over during the // parsing of the struct). - AddAlignmentAttributesForRecord(RD); - - AddMsStructLayoutForRecord(RD); + if (TUK == TUK_Definition) { + AddAlignmentAttributesForRecord(RD); + AddMsStructLayoutForRecord(RD); + } } if (ModulePrivateLoc.isValid()) { |