c++: fix initializer_list transformation [PR108071]
commit4ef521bbc63f8a3883d507a8b6c1f95f442df3fe
authorJason Merrill <jason@redhat.com>
Wed, 14 Dec 2022 22:42:52 +0000 (14 17:42 -0500)
committerJason Merrill <jason@redhat.com>
Thu, 15 Dec 2022 05:26:13 +0000 (15 00:26 -0500)
tree83306869a166ea795ca55b4d6944dce955803c04
parent26f4aefaebc056acacc2a842f5b092ed9e671ef0
c++: fix initializer_list transformation [PR108071]

In these testcases, we weren't adequately verifying that constructing the
element type from an array element would have the same effect as
constructing it from one of the initializers.

PR c++/108071
PR c++/105838

gcc/cp/ChangeLog:

* call.cc (struct conversion_obstack_sentinel): New.
(maybe_init_list_as_array): Compare conversion of dummy argument.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/initlist131.C: New test.
* g++.dg/cpp0x/initlist132.C: New test.
* g++.dg/cpp0x/initlist133.C: New test.
gcc/cp/call.cc
gcc/testsuite/g++.dg/cpp0x/initlist131.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/initlist132.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp0x/initlist133.C [new file with mode: 0644]