]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/compilable/issue9884.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / issue9884.d
CommitLineData
5fee5ec3
IB
1// https://issues.dlang.org/show_bug.cgi?id=9884
2module issue9884;
3
4const(int)[] data;
5
6static this()
7{
8 data = new int[10];
9 foreach (ref x; data) x = 1;
10 data[] = 1;
11}
12
13struct Foo
14{
15 static const(int)[] data;
16
17 static this()
18 {
19 this.data = new int[10];
20 foreach (ref x; this.data) x = 1;
21 this.data[] = 1;
22 }
23}
24
25void main() {}