gcc/testsuite/g++.dg/cpp2a/paren-init16.C
raw| 1 | // PR c++/91363 - P0960R3: Parenthesized initialization of aggregates. |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct S { int a[2]; }; |
| 5 | struct A { S s[1]; }; |
| 6 | |
| 7 | template <typename, int N> |
| 8 | struct R { static constexpr auto h = A({S{N}}); }; |
| 9 | |
| 10 | template <typename, int N> |
| 11 | struct R2 { static constexpr auto h = A({S({N, N})}); }; |
| 12 | |
| 13 | A foo = R<int, 10>::h; |
| 14 | A foo2 = R2<int, 10>::h; |