From: Jakub Jelinek Date: Mon, 25 Jun 2018 17:34:18 +0000 (+0200) Subject: backport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp... X-Git-Tag: releases/gcc-6.5.0~206 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a48ad3e4c72d06782ef8b8195aec1926809c5286;p=thirdparty%2Fgcc.git backport: re PR c++/84874 (internal compiler error: in reshape_init_class, at cp/decl.c:5800) Backported from mainline 2018-03-16 Jakub Jelinek PR c++/84874 * g++.dg/cpp1z/desig8.C: New test. From-SVN: r262078 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 65efe2139901..a37999339732 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -3,6 +3,9 @@ Backported from mainline 2018-03-16 Jakub Jelinek + PR c++/84874 + * g++.dg/cpp1z/desig8.C: New test. + PR c++/84874 * g++.dg/cpp1z/desig7.C: New test. diff --git a/gcc/testsuite/g++.dg/cpp1z/desig8.C b/gcc/testsuite/g++.dg/cpp1z/desig8.C new file mode 100644 index 000000000000..a6fc1600f5a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/desig8.C @@ -0,0 +1,18 @@ +// PR c++/84874 +// { dg-do compile { target c++1z } } +// { dg-options "" } + +struct A { int a; struct { int b; }; }; +struct B { A d; }; + +void +foo (B *x) +{ + *x = { .d = { .b = 5 } }; // { dg-message "non-trivial designated initializers not supported" } +} + +void +bar (A *x) +{ + *x = { .b = 6 }; // { dg-message "non-trivial designated initializers not supported" } +}