gcc/testsuite/g++.dg/cpp2a/constexpr-init23.C
raw| 1 | // PR c++/115900 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct A { |
| 5 | char m; |
| 6 | constexpr A() { m = 0; } |
| 7 | }; |
| 8 | |
| 9 | struct C { |
| 10 | constexpr C(){ }; |
| 11 | }; |
| 12 | |
| 13 | struct B : C { |
| 14 | A a; |
| 15 | constexpr B() {} |
| 16 | }; |
| 17 | |
| 18 | struct D : B { }; |
| 19 | |
| 20 | static constexpr A a; |
| 21 | static constexpr B b; |
| 22 | static constexpr D d; |