gcc/testsuite/g++.dg/cpp1y/constexpr-nsdmi10.C
raw| 1 | // PR c++/101073 |
| 2 | // { dg-do compile { target c++14 } } |
| 3 | // { dg-additional-options "-fno-elide-constructors" } |
| 4 | // A copy of constexpr-nsdmi9.C. |
| 5 | |
| 6 | struct Y |
| 7 | { |
| 8 | int a; |
| 9 | }; |
| 10 | |
| 11 | struct X |
| 12 | { |
| 13 | Y b = (c={5}); |
| 14 | Y c = (b={1}); |
| 15 | }; |
| 16 | |
| 17 | constexpr X o = { }; |
| 18 | static_assert(o.b.a == 1 && o.c.a == 1, ""); |