libstdc++-v3/ChangeLog:
* include/std/ranges (lazy_split_view::_OuterIter::_OuterIter):
Propagate _M_trailing_empty in the const-converting constructor
as per LWG 3904.
* testsuite/std/ranges/adaptors/adjacent/1.cc (test04): Correct
assertion.
* testsuite/std/ranges/adaptors/lazy_split.cc (test12): New test.
_OuterIter(_OuterIter<!_Const> __i)
requires _Const
&& convertible_to<iterator_t<_Vp>, iterator_t<_Base>>
- : _M_parent(__i._M_parent), _M_current(std::move(__i._M_current))
+ : _M_parent(__i._M_parent), _M_current(std::move(__i._M_current)),
+ _M_trailing_empty(__i._M_trailing_empty)
{ }
constexpr value_type
// 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 );
+ VERIFY( r.begin() != s );
return true;
}
#include <ranges>
#include <string>
#include <string_view>
+#include <utility>
#include <vector>
#include <testsuite_hooks.h>
#include <testsuite_iterators.h>
static_assert(ranges::distance(views::lazy_split("text"sv, ""sv)) == 4);
}
+constexpr bool
+test12()
+{
+ // LWG 3904
+ auto r = views::single(0) | views::lazy_split(0);
+ auto i = r.begin();
+ ++i;
+ VERIFY( i != r.end() );
+ decltype(std::as_const(r).begin()) j = i;
+ VERIFY( j != r.end() );
+
+ return true;
+}
+
int
main()
{
test09();
test10();
test11();
+ static_assert(test12());
}