| 1 |
// PR c++/109966 |
| 2 |
// { dg-do compile { target c++14 } } |
| 3 |
|
| 4 |
struct k { |
| 5 |
k(const char *); |
| 6 |
}; |
| 7 |
struct M { |
| 8 |
k name; |
| 9 |
int j = 42; |
| 10 |
int i = j; |
| 11 |
}; |
| 12 |
|
| 13 |
M m = M{""}; |
| 14 |
|
| 15 |
struct S { |
| 16 |
M arr1[1]{M{""}}; |
| 17 |
M a1[1] = { (M{""}) }; |
| 18 |
M a2[1] = { (true, M{""}) }; |
| 19 |
M a3[1] = { true ? M{""} : M{""} }; |
| 20 |
M arr2[2]{M{""}, M{""}}; |
| 21 |
M arr3[3]{M{""}, M{""}, M{""}}; |
| 22 |
|
| 23 |
M arr1e[1] = {M{""}}; |
| 24 |
M arr2e[2] = {M{""}, M{""}}; |
| 25 |
M arr3e[3] = {M{""}, M{""}, M{""}}; |
| 26 |
|
| 27 |
M arr1l[1] = { m }; |
| 28 |
M arr2l[2] = { m, m }; |
| 29 |
M arr3l[3] = { m, m, m }; |
| 30 |
|
| 31 |
M m1 = M{""}; |
| 32 |
M m2 = m; |
| 33 |
M m3{M{""}}; |
| 34 |
M m4 = {M{""}}; |
| 35 |
} o; |
| 36 |
|
| 37 |
struct N { |
| 38 |
N(M); |
| 39 |
}; |
| 40 |
|
| 41 |
struct Z { |
| 42 |
N arr1[1]{ M{""} }; |
| 43 |
N arr2[2]{ M{""}, M{""} }; |
| 44 |
N arr1e[1] = { M{""} }; |
| 45 |
N arr2e[2] = { M{""}, M{""} }; |
| 46 |
} z; |
| 47 |
|
| 48 |
struct Y { |
| 49 |
k name; |
| 50 |
int j = 42; |
| 51 |
int i = j; |
| 52 |
operator M(); |
| 53 |
}; |
| 54 |
|
| 55 |
struct W { |
| 56 |
M arr1[1]{ Y{""} }; |
| 57 |
M arr2[2]{ Y{""}, Y{""} }; |
| 58 |
M arr3[3]{ Y{""}, Y{""}, Y{""} }; |
| 59 |
} w; |