public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/109024] New: [C++23][ranges][repeat_view] The default ctor unuseable
@ 2023-03-04 16:03 yronglin777 at gmail dot com
  2023-03-06  1:05 ` [Bug libstdc++/109024] " de34 at live dot cn
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: yronglin777 at gmail dot com @ 2023-03-04 16:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109024
           Summary: [C++23][ranges][repeat_view] The default ctor
                    unuseable
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: yronglin777 at gmail dot com
  Target Milestone: ---

The default ctor of std::ranges::repeat_view<int> was unuseable.

https://godbolt.org/z/jxKMxEn7E

[P2474R2] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2474r2.html
```
repeat_view() requires default_initializable<W> = default;
```

```
#include <ranges>
#include <cassert>

void fn() {
    std::ranges::repeat_view<int> v;
}
```

```
In file included from <source>:1:
/opt/compiler-explorer/gcc-trunk-20230304/include/c++/13.0.1/ranges: In
instantiation of 'constexpr std::ranges::repeat_view<_Tp,
_Bound>::repeat_view() requires  default_initializable<_Tp> [with _Tp = int;
_Bound = std::unreachable_sentinel_t]':
<source>:5:35:   required from here
/opt/compiler-explorer/gcc-trunk-20230304/include/c++/13.0.1/ranges:7395:37:
error: could not convert '0' from 'int' to 'std::ranges::__detail::__box<int>'
 7395 |     __detail::__box<_Tp> _M_value = _Tp();
      |                                     ^~~~~
      |                                     |
      |                                     int
Compiler returned: 1
```

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

end of thread, other threads:[~2023-03-09 18:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-04 16:03 [Bug libstdc++/109024] New: [C++23][ranges][repeat_view] The default ctor unuseable yronglin777 at gmail dot com
2023-03-06  1:05 ` [Bug libstdc++/109024] " de34 at live dot cn
2023-03-06 16:42 ` redi at gcc dot gnu.org
2023-03-08 15:55 ` ppalka at gcc dot gnu.org
2023-03-09 18:37 ` cvs-commit at gcc dot gnu.org
2023-03-09 18:38 ` 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).