gcc/testsuite/g++.dg/cpp1y/constexpr-90383-2.C
raw| 1 | // PR c++/90383 |
| 2 | // { dg-do run { target c++14 } } |
| 3 | // { dg-options "-O2" } |
| 4 | |
| 5 | extern "C" void abort (); |
| 6 | struct alignas(8) A { constexpr A (bool x) : a(x) {} A () = default; bool a; }; |
| 7 | struct B { A b; }; |
| 8 | |
| 9 | constexpr bool |
| 10 | foo () |
| 11 | { |
| 12 | B w{A (true)}; |
| 13 | w.b = A (true); |
| 14 | return w.b.a; |
| 15 | } |
| 16 | |
| 17 | int |
| 18 | main () |
| 19 | { |
| 20 | if (!foo ()) |
| 21 | abort (); |
| 22 | } |