The patch removes alignment of virtual bases when an external layout is used. We have two cases:
- the external layout source has an information about virtual bases offsets, so we just use them;
- the external source has no information about virtual bases offsets. In this case we can't predict where the base will be located. If we will align it but there will be something like #pragma pack(push, 1) really, then likely our layout will not fit into the real structure size, and then some asserts will hit. The asserts look reasonable, so I don't think that we need to remove them. May be it would be better instead don't align fields / bases etc. (so treat it always as #pragma pack(push, 1)) when an external layout source is used but no info about a field location is presented.
This one is related to D49871
Also it seems that MicrosoftRecordLayoutBuilder with an external source and without one differ considerably, may be it is worth to split this and to create two different builders? I think that it would make the logic simpler. What do you think about it?