1 /* REQUIRED_ARGS: -preview=dip1000
4 fail_compilation/test18282.d(25): Error: scope variable `aa` may not be returned
5 fail_compilation/test18282.d(34): Error: copying `& i` into allocated memory escapes a reference to local variable `i`
6 fail_compilation/test18282.d(35): Error: copying `& i` into allocated memory escapes a reference to local variable `i`
7 fail_compilation/test18282.d(36): Error: scope variable `staa` may not be returned
8 fail_compilation/test18282.d(44): Error: copying `S2000(& i)` into allocated memory escapes a reference to local variable `i`
9 fail_compilation/test18282.d(53): Error: copying `& i` into allocated memory escapes a reference to local variable `i`
10 fail_compilation/test18282.d(53): Error: copying `& c` into allocated memory escapes a reference to local variable `c`
14 // https://issues.dlang.org/show_bug.cgi?id=18282
33 int*[1] staa
= [ &i
];
35 int*[ ] dynb
= [ &i
];
39 struct S2000
{ int* p
; }
44 S2000
[] arr
= [ S2000(&i
) ];
53 char*[int*] aa
= [ &i
: &c
];
57 /******************************
60 fail_compilation/test18282.d(1007): Error: copying `& foo` into allocated memory escapes a reference to local variable `foo`
61 fail_compilation/test18282.d(1008): Error: copying `& foo` into allocated memory escapes a reference to local variable `foo`
62 fail_compilation/test18282.d(1009): Error: copying `& foo` into allocated memory escapes a reference to local variable `foo`
63 fail_compilation/test18282.d(1016): Error: copying `&this` into allocated memory escapes a reference to parameter variable `this`
69 // https://issues.dlang.org/show_bug.cgi?id=18282
71 void test18282() @safe