Bug 268996 - The C++20 feature std::ranges::views::split is missing
Summary: The C++20 feature std::ranges::views::split is missing
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 13.1-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-standards (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-17 02:36 UTC by Yuri Victorovich
Modified: 2023-03-03 20:39 UTC (History)
2 users (show)

See Also:


Attachments
testcase.cpp (400 bytes, text/plain)
2023-01-17 02:36 UTC, Yuri Victorovich
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer freebsd_triage 2023-01-17 02:36:37 UTC
Created attachment 239524 [details]
testcase.cpp

The attached testcase uses the C++20 feature std::ranges::views::split
The C++ reference says that it should exist: https://en.cppreference.com/w/cpp/ranges/split_view
Both clang-14 from the base and clang-16 fail:
> testcase.cpp:9:31: error: no member named 'split' in namespace 'std::ranges::views'
>         | std::ranges::views::split(' ')
>           ~~~~~~~~~~~~~~~~~~~~^
> 1 error generated.

I couldn't match this feature with any missing parts of the C++20 standard in the "Clang C++20 implementation status" in https://clang.llvm.org/cxx_status.html
Comment 1 Mark Millard 2023-01-17 06:00:48 UTC
https://en.cppreference.com/w/cpp/compiler_support/20 has a
row for the "The One Ranges Proposal" that has a 15* listed.
The popup text for indicates that prior to clang16 it was
considered experimental and was disabled by default.
It does not list 16 explicitly, however.

https://releases.llvm.org/download.html does not even
list clang16 yet: not officially released yet.

https://libcxx.llvm.org/ReleaseNotes.html reports:
"The C++20 ranges library has been completed and is no
longer experimental. Some views have not been implemented
yet. Work on C++23 ranges has started."

https://libcxx.llvm.org/Status/Cxx20.html lists as "In
Progress": "Views should not be required to be default
constructible". It also indicates that status for
"P2210R2 LWG Superior String Splitting", which is about
split and such, see:

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p2210r2.html

( https://libcxx.llvm.org/Status/Cxx20.html is in some
ways more explicit than what cppreference.com lists. )

https://clang.llvm.org/cxx_status.html lists the compiler
as only partially supporting C++20 as well.
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2023-01-17 09:48:52 UTC
(In reply to Mark Millard from comment #1)

Thanks for the research, Mark.
Comment 3 Mark Millard 2023-02-09 05:11:13 UTC
(In reply to Yuri Victorovich from comment #2)

I'm going to remind that on FreeBSD, libc++ comes from the
system, not the devel/llvm* in use.

So, for example, with the import into main [so: 14] of llvm15,
an updated libc++ results, based on the llvm15 related update.

But it is going to be some time before main has llvm16 as a
basis, and so some time before the libc++ that goes with llvm16
will be in use.
Comment 4 Mark Millard 2023-03-03 20:39:19 UTC
(In reply to Yuri Victorovich from comment #0)

https://en.cppreference.com/w/cpp/23 now lists:

"DR: views::lazy_split and redesigned views::split"

as having support in g++ 12 and clang++ 17 .