gcc/testsuite/g++.dg/cpp2a/constexpr-init18.C
raw| 1 | // PR c++/96282 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct e { bool v = true; bool w; }; |
| 5 | |
| 6 | template<int N> |
| 7 | struct b { e m[N][N]; }; |
| 8 | |
| 9 | template<int N> |
| 10 | struct t : b<N> { constexpr t() : b<N>() {} }; |
| 11 | |
| 12 | constexpr t<1> h1; |
| 13 | static_assert(h1.m[0][0].w == false); |
| 14 | |
| 15 | constexpr t<42> h2; |
| 16 | static_assert(h2.m[17][17].w == false); |