]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Replace deduced return type in ranges::iter_move (PR 92894)
authorJonathan Wakely <jwakely@redhat.com>
Thu, 7 May 2020 16:39:56 +0000 (17:39 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 7 May 2020 20:07:09 +0000 (21:07 +0100)
commit6fedf28c7921f125be75a9f688a7b845a1b5663b
tree8a1dd862d3a9e93d48999d9ddab331429c7c04df
parente5613c55c2900cd23c9e78592f10258e19c74ab3
libstdc++: Replace deduced return type in ranges::iter_move (PR 92894)

The deduced return type causes the instantiation of the function body,
which can then require the instantiation of std::projected::operator*
which is intentionally not defined.

This patch uses a helper trait to define the return type, so that the
function body doesn't need to be instantiated.

Unlike on the master branch, this backport to gcc-10 does not change the
iter_rvalue_reference_t alias template and __indirectly_readable_impl
concept to use the new trait.

Backport from mainline
2020-05-01  Jonathan Wakely  <jwakely@redhat.com>
    Patrick Palka  <ppalka@redhat.com>

PR libstdc++/92894
* include/bits/iterator_concepts.h (ranges::__cust_imove::_IMove):
Add trait to determine return type and an alias for it.
(ranges::__cust_imove::_IMove::operator()): Use __result instead of
deduced return type.
* testsuite/24_iterators/customization_points/92894.cc: New test.
* testsuite/24_iterators/indirect_callable/92894.cc: New test.

Co-authored-by: Patrick Palka <ppalka@redhat.com>
libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/iterator_concepts.h
libstdc++-v3/testsuite/24_iterators/customization_points/92894.cc [new file with mode: 0644]
libstdc++-v3/testsuite/24_iterators/indirect_callable/92894.cc [new file with mode: 0644]