More rule enforcement of zero bitfields for ms_struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130696 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGRecordLayoutBuilder.cpp b/lib/CodeGen/CGRecordLayoutBuilder.cpp
index 3d9fd88..a4ac390 100644
--- a/lib/CodeGen/CGRecordLayoutBuilder.cpp
+++ b/lib/CodeGen/CGRecordLayoutBuilder.cpp
@@ -753,7 +753,8 @@
// Zero-length bitfields following non-bitfield members are
// ignored:
const FieldDecl *FD = (*Field);
- if (Types.getContext().ZeroBitfieldFollowsNonBitfield(FD, LastFD)) {
+ if (Types.getContext().ZeroBitfieldFollowsNonBitfield(FD, LastFD) ||
+ Types.getContext().ZeroBitfieldFollowsBitfield(FD, LastFD)) {
--FieldNo;
continue;
}
@@ -996,7 +997,8 @@
if (IsMsStruct) {
// Zero-length bitfields following non-bitfield members are
// ignored:
- if (getContext().ZeroBitfieldFollowsNonBitfield(FD, LastFD)) {
+ if (getContext().ZeroBitfieldFollowsNonBitfield(FD, LastFD) ||
+ getContext().ZeroBitfieldFollowsBitfield(FD, LastFD)) {
--i;
continue;
}