]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/fail_compilation/test16228.d
Add D front-end, libphobos library, and D2 testsuite.
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / test16228.d
1 /* REQUIRED_ARGS: -dip25
2 TEST_OUTPUT:
3 ---
4 fail_compilation/test16228.d(22): Error: function type 'return int()' has 'return' but does not return any indirections
5 fail_compilation/test16228.d(23): Error: function test16228.S.foo static member has no 'this' to which 'return' can apply
6 ---
7 */
8
9
10
11 // https://issues.dlang.org/show_bug.cgi?id=16228
12
13 int* wrap ( return ref int input )
14 {
15 return &input;
16 }
17
18 struct S
19 {
20 int x;
21
22 int foo() return { return 3; }
23 static ref int foo() return { return x; }
24 }