You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's specified in [class.copy.ctor] p15 and [class.copy.assign] p13 that a trivial and elegible copy or move function of a union copies the object representation, which can be problematic when the union object is a potentially-overlapping member subobject, and another subobject of the complete object overlaps with its tail padding, because the latter will be unintentionally overwritten.
Suggested resolution:
Change [class.copy.ctor] p15 as indicated:
The implicitly-defined copy/move constructor for a union X copies the objectvalue representation ([basic.types.general]) of X. [...]
Change [class.copy.assign] p13 as indicated:
The implicitly-defined copy/move assignment operator for a union X copies the objectvalue representation ([basic.types.general]) of X. [...]