]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Simplify C++20 poison pill overloads (P2602R2)
authorJonathan Wakely <jwakely@redhat.com>
Wed, 6 Sep 2023 12:36:02 +0000 (13:36 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 7 Sep 2023 07:08:12 +0000 (08:08 +0100)
commit6854e3ac71209ac786b878ef4abe6856a50c221d
treebec56718a88f540a7a3eb294070bc2f93c9c4b57
parentfaea9d92db9a339f5c2cf949e4890947287d7ef9
libstdc++: Simplify C++20 poison pill overloads (P2602R2)

This implements the C++23 change "Poison Pills are Too Toxic". This
makes sense to do unconditionally for C++20, as the corner cases that it
fixes are considered to be defects in the C++20 design (e.g. LWG3480 was
needed to fix directory iterators because of these pills being too
toxic).

libstdc++-v3/ChangeLog:

* include/bits/iterator_concepts.h (__imove::iter_move): Define
poison pill as deleted for consistency.
(__access::begin): Replace with a single declaration.
* include/bits/ranges_base.h (__access::end, __access::rbegin)
(__access::rend, __access::size): Likewise.
* include/bits/version.def (ranges): Update value for C++23.
* include/bits/version.h: Regenerate.
* libsupc++/compare (__compare): Add missing poison pill
overloads.
* testsuite/std/ranges/version_c++23.cc: Adjust expected value
of __cpp_lib_ranges.
* testsuite/std/ranges/access/p2602.cc: New test.
libstdc++-v3/include/bits/iterator_concepts.h
libstdc++-v3/include/bits/ranges_base.h
libstdc++-v3/include/bits/version.def
libstdc++-v3/include/bits/version.h
libstdc++-v3/libsupc++/compare
libstdc++-v3/testsuite/std/ranges/access/p2602.cc [new file with mode: 0644]
libstdc++-v3/testsuite/std/ranges/version_c++23.cc