https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78620

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #4)
> The list-initialization cases zero the padding bytes, but t he
> value-initialization cases don't.

Which seems backwards. struct tm is an aggregate, so {} performs aggregate
initialization which copy-initializes each member with {}. No zeroing of
padding bits between the aggregate members occurs. (For aggregate members that
are scalars or are classes with a default constructor, {} does
value-initialization, which does zero them, but padding bits between those
members isn't zeroed.)

So only the "value-initialization" and "placement new with
value-initialization" cases are required to zero the padding.

Reply via email to