On Thu, May 28, 2020 at 06:44:53AM -0700, H.J. Lu via Gcc-patches wrote: > On Wed, May 27, 2020 at 12:07 PM Jason Merrill via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > 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. > > > > Tested x86_64-pc-linux-gnu, applying to trunk and 10. > > > > 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. > > I got > > FAIL: g++.dg/cpp0x/initlist-array12.C -std=c++14 (test for excess errors) > FAIL: g++.dg/cpp0x/initlist-array12.C -std=c++17 (test for excess errors) > FAIL: g++.dg/cpp0x/initlist-array12.C -std=c++2a (test for excess errors)
This can be fixed with the attached patch. Jason, is it OK? > FAIL: g++.dg/ext/tmplattr10.C -std=c++98 (test for excess errors) But I don't know why this one fails. -- >8 -- * g++.dg/cpp0x/initlist-array12.C: Fix the definition of initializer_list for ilp32 target. --- gcc/testsuite/g++.dg/cpp0x/initlist-array12.C | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/g++.dg/cpp0x/initlist-array12.C b/gcc/testsuite/g++.dg/cpp0x/initlist-array12.C index b012e7295d5..168c5dd6492 100644 --- a/gcc/testsuite/g++.dg/cpp0x/initlist-array12.C +++ b/gcc/testsuite/g++.dg/cpp0x/initlist-array12.C @@ -1,10 +1,12 @@ // PR c++/95319 // { dg-do compile { target c++11 } } +typedef decltype(sizeof(char)) size_t; + namespace std { template <class> class initializer_list { int *_M_array; - unsigned long _M_len; + size_t _M_len; }; template <int _Nm> struct A { typedef int _Type[_Nm]; }; template <int _Nm> struct B { typename A<_Nm>::_Type _M_elems; }; base-commit: 3ea6977d0f1813d982743a09660eec1760e981ec -- Marek Polacek • Red Hat, Inc. • 300 A St, Boston, MA