If a program attempts to access (
[defns.access])
the stored value of an object through a glvalue
whose type is not similar (
[conv.qual]) to
one of the following types the behavior is
undefined:
- the dynamic type of the object,
- a type that is the signed or unsigned type corresponding to the
dynamic type of the object, or
- a char, unsigned char, or std::byte type.
If a program invokes
a defaulted copy/move constructor or copy/move assignment operator
for a union of type
U with a glvalue argument
that does not denote an object of type
cv U within its lifetime,
the behavior is undefined
.