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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Keywords|                            |wrong-code
          Component|libstdc++                   |c++
             Status|UNCONFIRMED                 |NEW
      Known to fail|                            |13.1.0, 14.0
      Known to work|                            |12.3.0
            Summary|[13 regression]             |[13/14 regression]
                   |initializer_list ctors of   |initializer_list ctors of
                   |containers skip             |containers skip
                   |Allocator_traits::construct |Allocator_traits::construct
                   |, copies move-only type     |, copies move-only type
   Last reconfirmed|                            |2023-06-03

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Arthur O'Dwyer from comment #0)
> My guess as to what's happening here:
> - We're definitely calling list(initializer_list<A>)

No we aren't.

The compiler transforms std::list{1,2,3} into std::list{il.begin(), il.end()}
where il is std::initializer_list<int>.

I think this changed with r13-4564-gd081807d8d70e3

We shouldn't be doing this transformation here, because A is a program-defined
type and we don't know its properties. The transformation is safe for
{"","",""} when initializing from std::initializer_list<std::string> but not
here.

Reply via email to