]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/compilable/fix20416.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / fix20416.d
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 }
36