Debian Codegraph @

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

raw
1 /*
2 https://issues.dlang.org/show_bug.cgi?id=20704
3 REQUIRED_ARGS: -preview=rvaluerefparam
4 */
5
6 void f1(T)(const auto ref T arg = T.init) {}
7 void f2(T)(const ref T arg = T.init) {}
8 void f3(T)(const auto ref T arg = 0) {}
9 void f4(T)(const ref T arg = 0) {}
10
11 struct S { int _; }
12 class C { int _; }
13
14 void main ()
15 {
16 int i;
17 f1!int(i);
18 f2!int(i);
19 f3!int(i);
20 f4!int(i);
21 f1!int();
22 f2!int();
23 f3!int();
24 f4!int();
25 f1!S();
26 f2!S();
27 f1!C();
28 f2!C();
29 }