[Bug c++/93916] Implicit copy/assignment alters padding bits of storage
andysem at mail dot ru
gcc-bugzilla@gcc.gnu.org
Tue Feb 25 11:26:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93916
--- Comment #8 from andysem at mail dot ru ---
(In reply to rguenther@suse.de from comment #5)
> > Is there any other way to achieve the effect of initializing padding in a
> > struct?
>
> The only way I see would be to do that inside the constructor but I
> realize that's not something you control?
Exactly. Also, I don't think you can portably access padding bits, except to do
memset over the object storage, like in my attempt. But then the constructor
has to manually initialize all members. And that would make the class
non-trivially copyable, which is not suitable in my case anyway.
More information about the Gcc-bugs
mailing list