================ @@ -64,6 +64,9 @@ FIELD(Abstract, 1, NO_MERGE) /// language rules (including DRs). FIELD(IsStandardLayout, 1, NO_MERGE) +/// True when this class appears as a member of some standard-layout union. +FIELD(IsStandardLayoutUnionMember, 1, MERGE_OR) + ---------------- AaronBallman wrote:
My intuition is that we should not be using a bit for this because `CXXRecordDecl::DefinitionData` is already 104 bytes (at least with MSVC) even with bit-field packing and memory overhead is a continual problem... but this also doesn't seem to add any overhead there, so maybe it's fine. However, I think that might be a pretty big change in approach to this PR because there's no easy way to ask "are there any standard layout unions which have a member with this class type?" But could we flip the logic to instead be triggered from the union definition instead of from the class definition? (I'm out of my depths here, so this might be unworkable or very far off base.) https://github.com/llvm/llvm-project/pull/221615 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
