[Bug c++/85548] Zero-initialization of padding bits of an aggregate class (class A) member of a non-aggregate class (class B) is not performed when B is value-initialized.
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Apr 27 12:21:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85548
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
Status|UNCONFIRMED |NEW
Last reconfirmed| |2018-04-27
Ever confirmed|0 |1
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Because the standard says so:
- if T is a (possibly cv-qualified) non-union class type, its padding bits
(6.7) are initialized to zero bits and each non-static data member, each
non-virtual base class subobject, and, if the object is not a base class
subobject, each virtual base class subobject is zero-initialized;
More information about the Gcc-bugs
mailing list