gcc/testsuite/gdc.dg/torture/pr120096.d
raw| 1 | // { dg-do run } |
| 2 | // { dg-additional-options "-fpreview=dip1000" } |
| 3 | // { dg-skip-if "needs gcc/config.d" { ! d_runtime } } |
| 4 | struct S |
| 5 | { |
| 6 | this(int p) nothrow @nogc @safe |
| 7 | { f = p; } |
| 8 | int f; |
| 9 | } |
| 10 | |
| 11 | int main() nothrow @nogc @safe |
| 12 | { |
| 13 | scope S[] sa = [S(1), S(2)]; |
| 14 | |
| 15 | assert(sa[0].f == 1); |
| 16 | assert(sa[1].f == 2); |
| 17 | return 0; |
| 18 | } |