Showing with 1 addition and 2 deletions.
  1. +1 −2 src/init.d
3 changes: 1 addition & 2 deletions src/init.d
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,7 @@ public:
for (size_t j = 0; j < nfields; j++)
{
VarDeclaration v2 = sd.fields[j];
bool overlap = (vd.offset < v2.offset + v2.type.size() && v2.offset < vd.offset + vd.type.size());
if (overlap && (*elements)[j])
if (vd.isOverlappedWith(v2) && (*elements)[j])
{
error(loc, "overlapping initialization for field %s and %s", v2.toChars(), vd.toChars());
errors = true;
Expand Down