public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/113068] New: <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor
@ 2023-12-18 15:57 hewillk at gmail dot com
2023-12-18 16:23 ` [Bug libstdc++/113068] " ppalka at gcc dot gnu.org
` (5 more replies)
0 siblings, 6 replies; 7+ messages in thread
From: hewillk at gmail dot com @ 2023-12-18 15:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113068
Bug ID: 113068
Summary: <ranges>: ranges::to<std::string>() |
ranges::to<std::string>() is not a range adaptor
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: hewillk at gmail dot com
Target Milestone: ---
libstdc++ rejects the following code, which it shouldn't be.
#include <ranges>
#include <string>
int main() {
auto adaptor = std::ranges::to<std::string>() |
std::ranges::to<std::string>();
auto str = adaptor(" ");
}
https://godbolt.org/z/7TrzcdTcz
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/113068] <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor
2023-12-18 15:57 [Bug libstdc++/113068] New: <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor hewillk at gmail dot com
@ 2023-12-18 16:23 ` ppalka at gcc dot gnu.org
2023-12-18 16:32 ` hewillk at gmail dot com
` (4 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-12-18 16:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113068
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
CC| |ppalka at gcc dot gnu.org
Last reconfirmed| |2023-12-18
Ever confirmed|0 |1
Depends on| |112802
--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
IIUC this will be fixed by making ranges::to's closure object SFINAE-friendly.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112802
[Bug 112802] <ranges>: _ToClosure::operator() has no constraints
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/113068] <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor
2023-12-18 15:57 [Bug libstdc++/113068] New: <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor hewillk at gmail dot com
2023-12-18 16:23 ` [Bug libstdc++/113068] " ppalka at gcc dot gnu.org
@ 2023-12-18 16:32 ` hewillk at gmail dot com
2023-12-18 17:19 ` ppalka at gcc dot gnu.org
` (3 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: hewillk at gmail dot com @ 2023-12-18 16:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113068
--- Comment #2 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to Patrick Palka from comment #1)
> IIUC this will be fixed by making ranges::to's closure object
> SFINAE-friendly.
I didn't investigate the root cause in depth. So this should probably be
considered a duplicate of PR 112802, right?
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/113068] <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor
2023-12-18 15:57 [Bug libstdc++/113068] New: <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor hewillk at gmail dot com
2023-12-18 16:23 ` [Bug libstdc++/113068] " ppalka at gcc dot gnu.org
2023-12-18 16:32 ` hewillk at gmail dot com
@ 2023-12-18 17:19 ` ppalka at gcc dot gnu.org
2023-12-18 23:06 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-12-18 17:19 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113068
--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
It could, but IMHO it's a different enough testcase/issue that a separate PR is
fine too.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/113068] <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor
2023-12-18 15:57 [Bug libstdc++/113068] New: <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor hewillk at gmail dot com
` (2 preceding siblings ...)
2023-12-18 17:19 ` ppalka at gcc dot gnu.org
@ 2023-12-18 23:06 ` cvs-commit at gcc dot gnu.org
2023-12-18 23:07 ` ppalka at gcc dot gnu.org
2023-12-18 23:07 ` ppalka at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-12-18 23:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113068
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:4f54e656788be3268dd45eb036447464a937fae9
commit r14-6668-g4f54e656788be3268dd45eb036447464a937fae9
Author: Patrick Palka <ppalka@redhat.com>
Date: Mon Dec 18 18:05:36 2023 -0500
libstdc++: Make ranges::to closure objects SFINAE-friendly [PR112802]
This also happens to fix composition of these closure objects.
PR libstdc++/112802
PR libstdc++/113068
libstdc++-v3/ChangeLog:
* include/std/ranges (__detail::_To::operator()): Add constraints.
(__detail::_To2::operator()): Likewise.
* testsuite/std/ranges/conv/1.cc (test_sfinae): New test.
(test_composition): New test.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/113068] <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor
2023-12-18 15:57 [Bug libstdc++/113068] New: <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor hewillk at gmail dot com
` (3 preceding siblings ...)
2023-12-18 23:06 ` cvs-commit at gcc dot gnu.org
@ 2023-12-18 23:07 ` ppalka at gcc dot gnu.org
2023-12-18 23:07 ` ppalka at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-12-18 23:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113068
Bug 113068 depends on bug 112802, which changed state.
Bug 112802 Summary: <ranges>: _ToClosure::operator() has no constraints
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112802
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Bug libstdc++/113068] <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor
2023-12-18 15:57 [Bug libstdc++/113068] New: <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor hewillk at gmail dot com
` (4 preceding siblings ...)
2023-12-18 23:07 ` ppalka at gcc dot gnu.org
@ 2023-12-18 23:07 ` ppalka at gcc dot gnu.org
5 siblings, 0 replies; 7+ messages in thread
From: ppalka at gcc dot gnu.org @ 2023-12-18 23:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113068
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |14.0
--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed, thanks!
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-12-18 23:07 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-18 15:57 [Bug libstdc++/113068] New: <ranges>: ranges::to<std::string>() | ranges::to<std::string>() is not a range adaptor hewillk at gmail dot com
2023-12-18 16:23 ` [Bug libstdc++/113068] " ppalka at gcc dot gnu.org
2023-12-18 16:32 ` hewillk at gmail dot com
2023-12-18 17:19 ` ppalka at gcc dot gnu.org
2023-12-18 23:06 ` cvs-commit at gcc dot gnu.org
2023-12-18 23:07 ` ppalka at gcc dot gnu.org
2023-12-18 23:07 ` ppalka at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).