public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/100475] New: semiregular-box's constructor uses wrong list-initialization
@ 2021-05-07 15:54 hewillk at gmail dot com
  2021-05-07 17:26 ` [Bug libstdc++/100475] " ppalka at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hewillk at gmail dot com @ 2021-05-07 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 100475
           Summary: semiregular-box's constructor uses wrong
                    list-initialization
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

The specialization of semiregular-box's constructor in ranges#L166:

template<typename... _Args>
  requires constructible_from<_Tp, _Args...>
  constexpr explicit
  __box(in_place_t, _Args&&... __args)
  noexcept(is_nothrow_constructible_v<_Tp, _Args...>)
  : _M_value{std::forward<_Args>(__args)...}
  { }

uses the wrong list-initialization, which will incorrectly construct the vector
with the initializer list in the following example:

#include <iostream>
#include <ranges>
#include <vector>

int main() {
  std::ranges::single_view<std::vector<int>> single(std::in_place, 100, 0);
  std::cout << single.begin()->size() << "\n"; 
}

https://godbolt.org/z/c88o3WzYP

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

end of thread, other threads:[~2021-10-12 18:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07 15:54 [Bug libstdc++/100475] New: semiregular-box's constructor uses wrong list-initialization hewillk at gmail dot com
2021-05-07 17:26 ` [Bug libstdc++/100475] " ppalka at gcc dot gnu.org
2021-05-07 17:34 ` hewillk at gmail dot com
2021-05-08  1:13 ` hewillk at gmail dot com
2021-05-08  2:12 ` hewillk at gmail dot com
2021-05-11 16:34 ` ppalka at gcc dot gnu.org
2021-05-18  4:35 ` cvs-commit at gcc dot gnu.org
2021-06-07  2:09 ` hewillk at gmail dot com
2021-06-07 11:39 ` redi at gcc dot gnu.org
2021-06-14  3:23 ` cvs-commit at gcc dot gnu.org
2021-10-12 18:44 ` ppalka at gcc dot gnu.org
2021-10-12 18:55 ` 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).