]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix the default constructor of ranges::__detail::__box
authorPatrick Palka <ppalka@redhat.com>
Fri, 30 Oct 2020 16:33:13 +0000 (12:33 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 30 Oct 2020 16:33:13 +0000 (12:33 -0400)
commitf3ced6772e2257bdef4e6f4dbdd0bdcf34b5bb3f
tree804e94af2e15a4b5cc080f9afcdf5c2f80eef3ac
parent24d762d1435257a8efd242c4a1a476c9b2037c03
libstdc++: Fix the default constructor of ranges::__detail::__box

The class template semiregular-box<T> of [range.semi.wrap] is specified
to value-initialize the underlying object whenever its type is default
initializable.  Our primary template for __detail::__box respects this
requirement, but the recently added partial specialization (for types
that are already semiregular) does not.

This patch fixes this issue, and additionally makes the corresponding in
place constructor explicit (as in the primary template).

libstdc++-v3/ChangeLog:

* include/std/ranges (__detail::__box): For the partial
specialization used by types that are already semiregular,
make the default constructor value-initialize the underlying
object instead of default-initializing it.  Make its in place
constructor explicit.
* testsuite/std/ranges/adaptors/detail/semiregular_box.cc:
Augment test.
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/adaptors/detail/semiregular_box.cc
This page took 0.066675 seconds and 6 git commands to generate.