This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[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.
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 27 Apr 2018 12:21:13 +0000
- Subject: [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.
- Auto-submitted: auto-generated
- References: <bug-85548-4@http.gcc.gnu.org/bugzilla/>
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;