libstdc++: Forward second argument of views::iota using the correct type
authorPatrick Palka <ppalka@redhat.com>
Thu, 20 Feb 2020 04:14:02 +0000 (23:14 -0500)
committerPatrick Palka <ppalka@redhat.com>
Thu, 20 Feb 2020 18:54:43 +0000 (13:54 -0500)
commit5586e5060fb6a30ade7a7ef854c21bb89b7065c9
tree29cf4865c99a47cf73071272d234b9dbd52c2264
parente6f24f824beb8ba6805702e287bbd6153b472488
libstdc++: Forward second argument of views::iota using the correct type

We are forwarding the second argument of views::iota using the wrong type,
causing compile errors when calling views::iota with a value and bound of
different types, like in the test case below.

libstdc++-v3/ChangeLog:

* include/std/ranges (iota_view): Forward declare _Sentinel.
(iota_view::_Iterator): Befriend _Sentinel.
(iota_view::_Sentinel::_M_equal): New member function.
(iota_view::_Sentinel::operator==): Use it.
(views::_Iota::operator()): Forward __f using the correct type.
* testsuite/std/ranges/access/ssize.cc (test06): Don't call views::iota
with integers of different signedness, to appease iota_view's deduction
guide.
* testsuite/std/ranges/iota/iota_view.cc: Augment test.
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/access/ssize.cc
libstdc++-v3/testsuite/std/ranges/iota/iota_view.cc