for (unsigned I = 0, N = Bases.size(); I != N; ++I) {
BaseInfo &Base = Bases[I];
- // Build the base class subobject at the appropriately-offset location
- // within this object.
- NextFieldOffsetInChars -= Base.Offset;
bool IsPrimaryBase = Layout.getPrimaryBase() == Base.Decl;
Build(Val.getStructBase(Base.Index), Base.Decl, IsPrimaryBase,
VTable, VTableClass, Offset + Base.Offset);
-
- NextFieldOffsetInChars += Base.Offset;
}
}
unsigned FieldNo = 0;
const FieldDecl *LastFD = 0;
bool IsMsStruct = RD->hasAttr<MsStructAttr>();
+ uint64_t OffsetBits = CGM.getContext().toBits(Offset);
for (RecordDecl::field_iterator Field = RD->field_begin(),
FieldEnd = RD->field_end(); Field != FieldEnd; ++Field, ++FieldNo) {
if (!Field->isBitField()) {
// Handle non-bitfield members.
- AppendField(*Field, Layout.getFieldOffset(FieldNo), EltInit);
+ AppendField(*Field, Layout.getFieldOffset(FieldNo) + OffsetBits, EltInit);
} else {
// Otherwise we have a bitfield.
- AppendBitField(*Field, Layout.getFieldOffset(FieldNo),
+ AppendBitField(*Field, Layout.getFieldOffset(FieldNo) + OffsetBits,
cast<llvm::ConstantInt>(EltInit));
}
}
struct Test2 : X<E,0>, X<E,1>, X<E,2>, X<E,3> {};
// CHECK: @_ZN9BaseClass2t2E = constant {{.*}} undef
extern constexpr Test2 t2 = Test2();
+
+ struct __attribute((packed)) PackedD { double y = 2; };
+ struct Test3 : C, PackedD { constexpr Test3() {} };
+ // CHECK: @_ZN9BaseClass2t3E = constant <{ i8, double }> <{ i8 1, double 2.000000e+00 }>
+ extern constexpr Test3 t3 = Test3();
}
namespace Array {