On Thu, May 28, 2020 at 10:16 AM Marek Polacek <pola...@redhat.com> wrote:
> On Thu, May 28, 2020 at 07:05:47AM -0700, H.J. Lu wrote: > > On Thu, May 28, 2020 at 6:57 AM Marek Polacek <pola...@redhat.com> > wrote: > > > > > > 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. > > > > [hjl@gnu-cfl-2 gcc]$ > > > /export/build/gnu/tools-build/gcc-debug/build-x86_64-linux/gcc/testsuite/g++/../../xg++ > > > -B/export/build/gnu/tools-build/gcc-debug/build-x86_64-linux/gcc/testsuite/g++/../../ > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C > > -m32 -fno-diagnostics-show-caret -fno-diagnostics-show-line-numbers > > -fdiagnostics-color=never -fdiagnostics-urls=never -nostdinc++ > > > -I/export/build/gnu/tools-build/gcc-debug/build-x86_64-linux/x86_64-pc-linux-gnu/32/libstdc++-v3/include/x86_64-pc-linux-gnu > > > -I/export/build/gnu/tools-build/gcc-debug/build-x86_64-linux/x86_64-pc-linux-gnu/32/libstdc++-v3/include > > -I/export/gnu/import/git/sources/gcc/libstdc++-v3/libsupc++ > > -I/export/gnu/import/git/sources/gcc/libstdc++-v3/include/backward > > -I/export/gnu/import/git/sources/gcc/libstdc++-v3/testsuite/util > > -fmessage-length=0 -std=c++98 -pedantic-errors -Wno-long-long -S -o > > tmplattr10.s > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:15:31: > > error: variadic templates only available with ‘-std=c++11’ or > > ‘-std=gnu++11’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:16:28: > > error: variadic templates only available with ‘-std=c++11’ or > > ‘-std=gnu++11’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:18:11: > > error: expected nested-name-specifier before ‘type’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:21:31: > > error: variadic templates only available with ‘-std=c++11’ or > > ‘-std=gnu++11’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:22:39: > > error: variadic templates only available with ‘-std=c++11’ or > > ‘-std=gnu++11’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:24:11: > > error: expected nested-name-specifier before ‘type’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:27:31: > > error: variadic templates only available with ‘-std=c++11’ or > > ‘-std=gnu++11’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:28:38: > > error: variadic templates only available with ‘-std=c++11’ or > > ‘-std=gnu++11’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:30:11: > > error: expected nested-name-specifier before ‘type’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:34:6: > > error: ISO C++ forbids declaration of ‘wrap’ with no type > > [-fpermissive] > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:34:1: > > error: top-level declaration of ‘wrap’ specifies ‘auto’ > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:34:51: > > error: trailing return type only available with ‘-std=c++11’ or > > ‘-std=gnu++11’ > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C: > > In function ‘int main()’: > > > /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/ext/tmplattr10.C:51:12: > > error: ‘wrap’ was not declared in this scope > > [hjl@gnu-cfl-2 gcc]$ > > I see, thanks. Jason, is this one OK too, then? > Yes, thanks. I wonder what was wrong with my testing setup that I didn't see these myself... > Tested > make check-g++ RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} > dg.exp=tmplattr10.C' > > -- >8 -- > This test uses C++11 features so should only run in c++11. > > * g++.dg/ext/tmplattr10.C: Only run in c++11. > --- > gcc/testsuite/g++.dg/ext/tmplattr10.C | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/testsuite/g++.dg/ext/tmplattr10.C > b/gcc/testsuite/g++.dg/ext/tmplattr10.C > index 3fb8c21ccbe..46caa070098 100644 > --- a/gcc/testsuite/g++.dg/ext/tmplattr10.C > +++ b/gcc/testsuite/g++.dg/ext/tmplattr10.C > @@ -1,5 +1,5 @@ > // PR c++/95222 > -// { dg-do compile { target { { i?86-*-* x86_64-*-* } && ia32 } } } > +// { dg-do compile { target { { { i?86-*-* x86_64-*-* } && ia32 } && > c++11 } } } > > #if defined(_MSC_VER) > #define CC_FASTCALL __fastcall > > base-commit: 3ea6977d0f1813d982743a09660eec1760e981ec > -- > Marek Polacek • Red Hat, Inc. • 300 A St, Boston, MA > >