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

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).