Skip to content

Commit b713484

Browse files
H-G-HristovZingam
andauthored
[libc++][ranges] LWG3505: split_view::outer-iterator::operator++ misspecified (#155160)
Implemented in LLVM15: e53c461 This LWG concerns`lazy_split_view` despite the outdated title. Closes #104320 # References - https://wg21.link/LWG3505 - https://wg21.link/range.lazy.split.outer Co-authored-by: Hristo Hristov <[email protected]>
1 parent b196c52 commit b713484

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

libcxx/docs/Status/Cxx23Issues.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"`LWG3495 <https://wg21.link/LWG3495>`__","``constexpr launder`` makes pointers to inactive members of unions usable","2021-02 (Virtual)","|Nothing To Do|","","`#104316 <https://github.com/llvm/llvm-project/issues/104316>`__",""
5959
"`LWG3500 <https://wg21.link/LWG3500>`__","``join_view::iterator::operator->()`` is bogus","2021-02 (Virtual)","|Complete|","14","`#104318 <https://github.com/llvm/llvm-project/issues/104318>`__",""
6060
"`LWG3502 <https://wg21.link/LWG3502>`__","``elements_view`` should not be allowed to return dangling reference","2021-02 (Virtual)","|Complete|","16","`#104319 <https://github.com/llvm/llvm-project/issues/104319>`__",""
61-
"`LWG3505 <https://wg21.link/LWG3505>`__","``split_view::outer-iterator::operator++`` misspecified","2021-02 (Virtual)","","","`#104320 <https://github.com/llvm/llvm-project/issues/104320>`__",""
61+
"`LWG3505 <https://wg21.link/LWG3505>`__","``split_view::outer-iterator::operator++`` misspecified","2021-02 (Virtual)","|Complete|","15","`#104320 <https://github.com/llvm/llvm-project/issues/104320>`__",""
6262
"","","","","","",""
6363
"`LWG2774 <https://wg21.link/LWG2774>`__","``std::function`` construction vs assignment","2021-06 (Virtual)","","","`#104321 <https://github.com/llvm/llvm-project/issues/104321>`__",""
6464
"`LWG2818 <https://wg21.link/LWG2818>`__","``::std::`` everywhere rule needs tweaking","2021-06 (Virtual)","|Nothing To Do|","","`#104322 <https://github.com/llvm/llvm-project/issues/104322>`__",""

libcxx/test/std/ranges/range.adaptors/range.lazy.split/range.lazy.split.outer/increment.pass.cpp

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,56 @@ constexpr bool test() {
7575
}
7676
}
7777

78+
// LWG3505
79+
{
80+
using namespace std::string_view_literals;
81+
82+
{ // Motivational example
83+
auto v = std::views::lazy_split("xxyx"sv, "xy"sv);
84+
85+
{
86+
auto i = v.begin();
87+
assert(std::ranges::equal(*i, "x"s));
88+
89+
decltype(auto) i2 = ++i;
90+
static_assert(std::is_lvalue_reference_v<decltype(i2)>);
91+
assert(std::ranges::equal(*i2, "x"s));
92+
}
93+
94+
{
95+
auto i = v.begin();
96+
assert(std::ranges::equal(*i, "x"s));
97+
98+
decltype(auto) i2 = i++;
99+
static_assert(!std::is_reference_v<decltype(i2)>);
100+
assert(std::ranges::equal(*i2, "x"s));
101+
assert(std::ranges::equal(*i, "x"s));
102+
}
103+
}
104+
{
105+
auto v = std::views::lazy_split("zzht"sv, "zh"sv);
106+
107+
{
108+
auto i = v.begin();
109+
assert(std::ranges::equal(*i, "z"s));
110+
111+
decltype(auto) i2 = ++i;
112+
static_assert(std::is_lvalue_reference_v<decltype(i2)>);
113+
assert(std::ranges::equal(*i2, "t"s));
114+
}
115+
116+
{
117+
auto i = v.begin();
118+
assert(std::ranges::equal(*i, "z"s));
119+
120+
decltype(auto) i2 = i++;
121+
static_assert(!std::is_reference_v<decltype(i2)>);
122+
assert(std::ranges::equal(*i2, "z"s));
123+
assert(std::ranges::equal(*i, "t"s));
124+
}
125+
}
126+
}
127+
78128
return true;
79129
}
80130

0 commit comments

Comments
 (0)