https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70526
Alexander Monakov <amonakov at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amonakov at gcc dot gnu.org
--- Comment #18 from Alexander Monakov <amonakov at gcc dot gnu.org> ---
Richard -- please correct if I'm wrong -- means here:
> You can't refer to that part of the storage by copying *this.
... that the implicitly instantiated copy constructor (as well as assignment
operator, for that matter) will copy this->typed as a char[]/uint64_t union,
while it actually contains a value of type Register. You need an explicit copy
constructor that would assign this->typed with the correct type via
'typed.addr() = ...' like the existing constructor does.
(If T was POD, you could have had it in the union in the first place, and this
issue wouldn't arise)