[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.

2021-11-08 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85548

--- Comment #4 from Jonathan Wakely  ---
__builtin_clear_padding is for libstdc++ to clear padding bits in arbitrary
trivially-copyable objects, it's not useful here because the compiler should be
doing it automatically.

[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.

2021-11-08 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85548

Andrew Pinski  changed:

   What|Removed |Added

   Last reconfirmed|2018-11-22 00:00:00 |2021-11-8

--- Comment #3 from Andrew Pinski  ---
Seems like now we have __builtin_clear_padding this might be added here.

[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.

2018-04-27 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85548

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||wrong-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-04-27
 Ever confirmed|0   |1

--- Comment #2 from Jonathan Wakely  ---
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;

[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.

2018-04-27 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85548

--- Comment #1 from Richard Biener  ---
Why do you think padding should be initialized in any way?