c++: Handle multiple aggregate overloads [PR95319].
authorJason Merrill <jason@redhat.com>
Wed, 27 May 2020 14:27:25 +0000 (10:27 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 27 May 2020 17:56:56 +0000 (13:56 -0400)
commit6efa97ea1d2fe6df1fbb9df78faaa2248a8618d7
tree91fc64c10ba4920564cb1170a6e5937d7194b45a
parenta7fd43c38f7469a3ef5ee30e889d60e1376d4dfc
c++: Handle multiple aggregate overloads [PR95319].

Here, when considering the two 'insert' overloads, we look for aggregate
conversions from the same initializer-list to B<3> or
initializer_list<B<3>>.  But since my fix for reshape_init overhead on the
PR14179 testcase we reshaped the initializer-list directly, leading to an
error when we then tried to reshape it differently for the second overload.

gcc/cp/ChangeLog:

PR c++/95319
* decl.c (reshape_init_array_1): Don't reuse in overload context.

gcc/testsuite/ChangeLog:

PR c++/95319
* g++.dg/cpp0x/initlist-array12.C: New test.
gcc/cp/decl.c
gcc/testsuite/g++.dg/cpp0x/initlist-array12.C [new file with mode: 0644]