mirror of
https://github.com/intel/llvm.git
synced 2026-01-12 18:27:07 +08:00
[libc++][ranges] LWG3505: split_view::outer-iterator::operator++ misspecified (#155160)
Implemented in LLVM15:
e53c461bf3
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 <zingam@outlook.com>
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
"`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>`__",""
|
||||
"`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>`__",""
|
||||
"`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>`__",""
|
||||
"`LWG3505 <https://wg21.link/LWG3505>`__","``split_view::outer-iterator::operator++`` misspecified","2021-02 (Virtual)","","","`#104320 <https://github.com/llvm/llvm-project/issues/104320>`__",""
|
||||
"`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>`__",""
|
||||
"","","","","","",""
|
||||
"`LWG2774 <https://wg21.link/LWG2774>`__","``std::function`` construction vs assignment","2021-06 (Virtual)","","","`#104321 <https://github.com/llvm/llvm-project/issues/104321>`__",""
|
||||
"`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>`__",""
|
||||
|
||||
|
@@ -75,6 +75,56 @@ constexpr bool test() {
|
||||
}
|
||||
}
|
||||
|
||||
// LWG3505
|
||||
{
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
{ // Motivational example
|
||||
auto v = std::views::lazy_split("xxyx"sv, "xy"sv);
|
||||
|
||||
{
|
||||
auto i = v.begin();
|
||||
assert(std::ranges::equal(*i, "x"s));
|
||||
|
||||
decltype(auto) i2 = ++i;
|
||||
static_assert(std::is_lvalue_reference_v<decltype(i2)>);
|
||||
assert(std::ranges::equal(*i2, "x"s));
|
||||
}
|
||||
|
||||
{
|
||||
auto i = v.begin();
|
||||
assert(std::ranges::equal(*i, "x"s));
|
||||
|
||||
decltype(auto) i2 = i++;
|
||||
static_assert(!std::is_reference_v<decltype(i2)>);
|
||||
assert(std::ranges::equal(*i2, "x"s));
|
||||
assert(std::ranges::equal(*i, "x"s));
|
||||
}
|
||||
}
|
||||
{
|
||||
auto v = std::views::lazy_split("zzht"sv, "zh"sv);
|
||||
|
||||
{
|
||||
auto i = v.begin();
|
||||
assert(std::ranges::equal(*i, "z"s));
|
||||
|
||||
decltype(auto) i2 = ++i;
|
||||
static_assert(std::is_lvalue_reference_v<decltype(i2)>);
|
||||
assert(std::ranges::equal(*i2, "t"s));
|
||||
}
|
||||
|
||||
{
|
||||
auto i = v.begin();
|
||||
assert(std::ranges::equal(*i, "z"s));
|
||||
|
||||
decltype(auto) i2 = i++;
|
||||
static_assert(!std::is_reference_v<decltype(i2)>);
|
||||
assert(std::ranges::equal(*i2, "z"s));
|
||||
assert(std::ranges::equal(*i, "t"s));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user