Debian Codegraph @

gcc/testsuite/gdc.test/compilable/fix20416.d

raw
1 /* REQUIRED_ARGS: -preview=dip1000
2 */
3
4 /********************************************/
5
6 // https://issues.dlang.org/show_bug.cgi?id=20416
7
8 alias P = int*;
9
10 ref P foo(return ref P);
11
12 P bar()
13 {
14 P result;
15 return foo(result);
16 }
17
18
19 /********************************************/
20
21 // https://issues.dlang.org/show_bug.cgi?id=20416
22
23
24 struct S
25 {
26 string x;
27 ref S foo() return;
28 }
29
30
31 S bar2()
32 {
33 S result;
34 return result.foo();
35 }