]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Add missing initializers for __maybe_present_t members [PR119962]
authorPatrick Palka <ppalka@redhat.com>
Tue, 15 Jul 2025 19:17:23 +0000 (15:17 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 15 Jul 2025 19:17:23 +0000 (15:17 -0400)
commit0828600f586e75a2056a4fc7eb0a340c363d6c66
tree3498358d380fd90c5001ba7e9497419eb8a1b02f
parent35b19980046fc57d9d6851b8f4349bd22de3fa03
libstdc++: Add missing initializers for __maybe_present_t members [PR119962]

Data members of type __maybe_present_t where the conditionally present
type might be an aggregate or fundamental type need to be explicitly
value-initialized (rather than implicitly default-initialized), so that
default-initialization of the containing class always results in an
completely initialized object.

PR libstdc++/119962

libstdc++-v3/ChangeLog:

* include/std/ranges (join_view::_Iterator::_M_outer): Initialize.
(lazy_split_view::_OuterIter::_M_current): Initialize.
(join_with_view::_Iterator::_M_outer_it): Initialize.
* testsuite/std/ranges/adaptors/join.cc (test15): New test.
* testsuite/std/ranges/adaptors/join_with/1.cc (test05): New test.
* testsuite/std/ranges/adaptors/lazy_split.cc (test13): New test.

Reviewed-by: Tomasz KamiƄski <tkaminsk@redhat.com>
Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/adaptors/join.cc
libstdc++-v3/testsuite/std/ranges/adaptors/join_with/1.cc
libstdc++-v3/testsuite/std/ranges/adaptors/lazy_split.cc