MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail17842.d
blob734f8d795e072ca40145be4b6a428ceba77fd752
1 /* REQUIRED_ARGS: -preview=dip1000
2 * TEST_OUTPUT:
3 ---
4 fail_compilation/fail17842.d(14): Error: scope variable `p` assigned to non-scope `*q`
5 fail_compilation/fail17842.d(23): Error: scope variable `obj` may not be copied into allocated memory
6 ---
7 */
9 // https://issues.dlang.org/show_bug.cgi?id=17842
11 void* testp(scope void* p) @safe
13 scope void** q;
14 *q = p; // error
15 void** t;
16 *t = *q;
17 return *t;
20 Object testobj(scope Object obj) @safe
22 scope Object[] arr;
23 arr ~= obj; // error
24 Object[] array;
25 array ~= arr;
26 return array[0];