gcc/testsuite/g++.dg/cpp2a/paren-init7.C
raw| 1 | // PR c++/91363 - P0960R3: Parenthesized initialization of aggregates. |
| 2 | // { dg-do run { target c++20 } } |
| 3 | |
| 4 | int h; |
| 5 | struct i { |
| 6 | i() {} |
| 7 | explicit i(i &) {} |
| 8 | template <typename j> i(j &) { h++; } |
| 9 | }; |
| 10 | |
| 11 | int main() { |
| 12 | { |
| 13 | i a[6]; |
| 14 | auto [b, c, d, e, f, g] = a; |
| 15 | } |
| 16 | i a[6]; |
| 17 | auto [b, c, d, e, f, g](a); |
| 18 | if (h != 6) |
| 19 | __builtin_abort(); |
| 20 | } |