MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / dip25.d
blobf43a6e9ef8d1d4af8fed8ab5c6a22b6fd2adc411
1 /*
2 REQUIRED_ARGS:
3 TEST_OUTPUT:
4 ---
5 fail_compilation/dip25.d(17): Error: returning `this.buffer[]` escapes a reference to parameter `this`
6 fail_compilation/dip25.d(15): perhaps annotate the function with `return`
7 fail_compilation/dip25.d(22): Error: returning `identity(x)` escapes a reference to parameter `x`
8 fail_compilation/dip25.d(23): Error: returning `identity(x)` escapes a reference to parameter `x`
9 fail_compilation/dip25.d(23): perhaps annotate the parameter with `return`
10 ---
12 struct Data
14 char[256] buffer;
15 @property const(char)[] filename() const pure nothrow @safe
17 return buffer[];
21 ref int identity(return ref int x) @safe { return x; }
22 ref int fun(return int x) @safe { return identity(x); }
23 ref int fun2(ref int x) @safe { return identity(x); }
25 void main()
27 Data d;
28 const f = d.filename;