gcc/testsuite/g++.dg/cpp2a/paren-init15.C
raw| 1 | // PR c++/91363 - P0960R3: Parenthesized initialization of aggregates. |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | struct A { |
| 5 | int i; |
| 6 | int j; |
| 7 | }; |
| 8 | |
| 9 | struct B : A |
| 10 | { |
| 11 | B (): A(1.7, 2) { } |
| 12 | }; |
| 13 | |
| 14 | void f(A); |
| 15 | |
| 16 | void |
| 17 | g () |
| 18 | { |
| 19 | f (A(1, 2)); |
| 20 | } |
| 21 | |
| 22 | struct S { |
| 23 | int a[2]; |
| 24 | }; |
| 25 | |
| 26 | S h() { return S({1, 2}); } |
| 27 | |
| 28 | struct Z { |
| 29 | int i; |
| 30 | int j; |
| 31 | operator A(); |
| 32 | }; |
| 33 | |
| 34 | Z z; |
| 35 | A a = Z(1, 2.3); |