aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
authorPatrick Palka <ppalka@redhat.com>2022-09-09 14:56:37 -0400
committerPatrick Palka <ppalka@redhat.com>2022-09-09 14:56:37 -0400
commite469506b7fdd1bf2c958ca3140573a474fcba3b8 (patch)
tree2c6510537700d8c75413eda55c700e44003f09ef /libstdc++-v3
parent718a6d475b3d17759618c68331c85f55c58ec9a3 (diff)
downloadgcc-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/ranges2
-rw-r--r--libstdc++-v3/testsuite/std/ranges/adaptors/adjacent/1.cc12
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());
}