diff options
author | Patrick Palka <ppalka@redhat.com> | 2022-09-09 14:56:37 -0400 |
---|---|---|
committer | Patrick Palka <ppalka@redhat.com> | 2022-09-09 14:56:37 -0400 |
commit | e469506b7fdd1bf2c958ca3140573a474fcba3b8 (patch) | |
tree | 2c6510537700d8c75413eda55c700e44003f09ef /libstdc++-v3 | |
parent | 718a6d475b3d17759618c68331c85f55c58ec9a3 (diff) | |
download | gcc-e469506b7fdd1bf2c958ca3140573a474fcba3b8.zip gcc-e469506b7fdd1bf2c958ca3140573a474fcba3b8.tar.gz gcc-e469506b7fdd1bf2c958ca3140573a474fcba3b8.tar.bz2 |
libstdc++: Fix typo in adjacent_view::_Iterator [PR106798]
PR libstdc++/106798
libstdc++-v3/ChangeLog:
* include/std/ranges (adjacent_view::_Iterator::_Iterator): Fix
typo.
* testsuite/std/ranges/adaptors/adjacent/1.cc (test04): New test.
Diffstat (limited to 'libstdc++-v3')
-rw-r--r-- | libstdc++-v3/include/std/ranges | 2 | ||||
-rw-r--r-- | libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 2b8fec3..37ad80a 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -5239,7 +5239,7 @@ namespace views::__adaptor requires _Const && convertible_to<iterator_t<_Vp>, iterator_t<_Base>> { for (size_t __j = 0; __j < _Nm; ++__j) - _M_current[__j] = std::move(__i[__j]); + _M_current[__j] = std::move(__i._M_current[__j]); } constexpr auto diff --git a/libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc b/libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc index 9829f79..443c1fb 100644 --- a/libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc @@ -101,10 +101,22 @@ test03() return true; } +constexpr bool +test04() +{ + // PR libstdc++/106798 + auto r = views::single(0) | views::lazy_split(0) | views::pairwise; + decltype(ranges::cend(r)) s = r.end(); + VERIFY( r.begin() == s ); + + return true; +} + int main() { static_assert(test01()); static_assert(test02()); static_assert(test03()); + static_assert(test04()); } |