From a1c56deaa2d0e9d345374e8062671038f43b0b47 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 29 Mar 2019 15:24:00 +0000 Subject: [PATCH] re PR c++/89871 (Wall + designated initializers) PR c++/89871 * g++.dg/cpp2a/desig14.C: New test. From-SVN: r270019 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp2a/desig14.C | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp2a/desig14.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 08d0609e2e0..0d954bfe2bb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-03-29 Marek Polacek + + PR c++/89871 + * g++.dg/cpp2a/desig14.C: New test. + 2019-03-29 Martin Liska * gcc.dg/ipa/ipa-icf-39.c: Prine '***dbgcnt' output. diff --git a/gcc/testsuite/g++.dg/cpp2a/desig14.C b/gcc/testsuite/g++.dg/cpp2a/desig14.C new file mode 100644 index 00000000000..cfcaa88485c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/desig14.C @@ -0,0 +1,18 @@ +// PR c++/89871 +// { dg-do compile { target c++11 } } +// { dg-options "-Wall" } + +struct A {}; +struct B {}; + +struct S { + union { + A a; + B b; + }; +}; + +int main() { + S s; + s = S{.a = A{}}; +} -- 2.30.2