public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/113154] New: std::views::values not working with rvalue references to ranges
@ 2023-12-27  2:35 ivan.lazaric.gcc at gmail dot com
  2023-12-27  2:57 ` [Bug libstdc++/113154] [11 only] " pinskia at gcc dot gnu.org
  2023-12-28  1:10 ` redi at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: ivan.lazaric.gcc at gmail dot com @ 2023-12-27  2:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113154

            Bug ID: 113154
           Summary: std::views::values not working with rvalue references
                    to ranges
           Product: gcc
           Version: 11.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ivan.lazaric.gcc at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/a3c4P9sY6

```
#include <ranges>
#include <map>

void fn(){
    std::map<int, int> m;
    m | std::views::values; // works
    std::map<int, int>{} | std::views::values; // does not work

}
```

not an issue in newer versions, checked 13.2 and it worked

came across this by wanting to do:
```
std::map<Keys, Values> produce_map();

std::cout << std::ranges::max(produce_map | std::views::values) << std::endl;
```

options used: -std=c++20 -O3

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libstdc++/113154] [11 only] std::views::values not working with rvalue references to ranges
  2023-12-27  2:35 [Bug c++/113154] New: std::views::values not working with rvalue references to ranges ivan.lazaric.gcc at gmail dot com
@ 2023-12-27  2:57 ` pinskia at gcc dot gnu.org
  2023-12-28  1:10 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-27  2:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113154

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.5
            Summary|std::views::values not      |[11 only]
                   |working with rvalue         |std::views::values not
                   |references to ranges        |working with rvalue
                   |                            |references to ranges
           Keywords|                            |needs-bisection
          Component|c++                         |libstdc++

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I doubt, the patch which fixed this can/will be backported to the GCC 11
releases.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug libstdc++/113154] [11 only] std::views::values not working with rvalue references to ranges
  2023-12-27  2:35 [Bug c++/113154] New: std::views::values not working with rvalue references to ranges ivan.lazaric.gcc at gmail dot com
  2023-12-27  2:57 ` [Bug libstdc++/113154] [11 only] " pinskia at gcc dot gnu.org
@ 2023-12-28  1:10 ` redi at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: redi at gcc dot gnu.org @ 2023-12-28  1:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113154

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #1)
> I doubt, the patch which fixed this can/will be backported to the GCC 11
> releases.

Right. GCC 11 is correct according to the C++20 standard, but the semantics
were changed after the C++20 standard was published. That was implemented in
GCC with:

commit 5e1b17f038671df1a6580ece4cd58ef91cc1e234
Author: Patrick Palka
Date:   Tue Feb 22 09:37:58 2022 -0500

    libstdc++: Implement P2415R2 changes to viewable_range / views::all

    This implements the wording changes in P2415R2 "What is a view?", which
    is a DR for C++20.

I don't think we want to backport it.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-28  1:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-27  2:35 [Bug c++/113154] New: std::views::values not working with rvalue references to ranges ivan.lazaric.gcc at gmail dot com
2023-12-27  2:57 ` [Bug libstdc++/113154] [11 only] " pinskia at gcc dot gnu.org
2023-12-28  1:10 ` redi 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).