]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix fallout from P2321R2 std::pair/tuple enhancements
authorPatrick Palka <ppalka@redhat.com>
Wed, 24 Aug 2022 20:38:45 +0000 (16:38 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 24 Aug 2022 20:38:45 +0000 (16:38 -0400)
commitf46f58e61db3b1e71beb21443c0ca9387bc836e2
tree076b8e305f025c5d2a86f8ffe71e79340c507746
parentdf5204ddd4b8e3a2d02bb3ad5bcdb9d636b02537
libstdc++: Fix fallout from P2321R2 std::pair/tuple enhancements

r13-2159-g72886fcc626953 caused some testsuite regressions in C++23 mode:

  FAIL: 20_util/pair/requirements/explicit_instantiation/1.cc (test for excess errors)
  FAIL: 20_util/tuple/53648.cc (test for excess errors)
  FAIL: 20_util/tuple/cons/noexcept_specs.cc (test for excess errors)
  FAIL: 20_util/tuple/requirements/explicit_instantiation.cc (test for excess errors)

The test noexcept_specs.cc just needs to be updated to consider the
additional converting constructors of tuple in C++23 mode, which happen
to improve constructing from a const tuple rvalue that has an rvalue
reference element (for the better, as far as I can tell).

The other three tests fail because they explicitly instantiate a
specialization of pair/tuple whose elements are not all const swappable,
which in C++23 mode now results in a hard error due to the new const
swap member function.  Rather than XFAILing the tests in C++23 mode,
this patch adds non-standard constraints to this member function so that
we continue to accept such explicit instantiations.

libstdc++-v3/ChangeLog:

* include/bits/stl_pair.h (pair::swap const): Add non-standard
is_swappable_v constraints.
* include/std/tuple (tuple::swap const): Likewise.
* testsuite/20_util/tuple/cons/noexcept_specs.cc: Correct some
asserts in C++23 mode.
libstdc++-v3/include/bits/stl_pair.h
libstdc++-v3/include/std/tuple
libstdc++-v3/testsuite/20_util/tuple/cons/noexcept_specs.cc
This page took 0.061353 seconds and 6 git commands to generate.