Debian Codegraph @

gcc/testsuite/gdc.dg/gdc300.d

raw
1 // https://bugzilla.gdcproject.org/show_bug.cgi?id=300
2 // { dg-additional-options "-fmain" }
3 // { dg-do link { target d_runtime_has_std_library } }
4
5 struct S300(Range)
6 {
7 double test(size_t remaining)
8 {
9 double r;
10 return r ^^ remaining;
11 }
12 }
13
14 auto link300a(Range)(Range)
15 {
16 return S300!(Range)();
17 }
18
19 void link300()
20 {
21 struct I {}
22 static assert(is(typeof(link300a(I())) == struct));
23 auto sample = link300a(I());
24 sample.test(5);
25 }