gcc/testsuite/g++.dg/cpp2a/constexpr-init9.C
raw| 1 | // PR c++/91353 - P1331R2: Allow trivial default init in constexpr contexts. |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct S { |
| 5 | constexpr S(int) {} |
| 6 | }; |
| 7 | |
| 8 | struct W { |
| 9 | constexpr W(int (&)[8]) : W(8) { } |
| 10 | constexpr W(int) : s(8), p() {} |
| 11 | |
| 12 | S s; |
| 13 | int *p; |
| 14 | }; |
| 15 | |
| 16 | int arr[8]; |
| 17 | constexpr auto a = W(arr); |