Debian Codegraph @

gcc/testsuite/gdc.test/runnable/test20809.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=20809
2
3
4 @safe:
5 struct S{
6 @safe:
7 int[8] a;
8 ~this(){ a[] = 0; }
9 ref val(){ return a; }
10 }
11 S bar(){ return S([2,2,2,2,2,2,2,2]); }
12 int[8] foo(){ return bar.val; }
13
14 void main(){ assert(foo() == [2,2,2,2,2,2,2,2]); } // error