d: Merge upstream dmd 568496d5b, druntime 178c44ff, phobos 574bf883b.
[official-gcc.git] / gcc / testsuite / gdc.test / compilable / b20938.d
blobefcf4aab06fbc05089bd2dc8b7e0092c11a720d0
1 // issue 20938 - Cannot create const arrays mixing immutable and mutable structs with indirections
2 struct S { int[] a; }
3 enum A { a }
4 enum B { b }
6 void fun() {
7 int* pi;
8 immutable int* ipi;
9 int[] ai;
10 immutable int[] iai;
11 S s;
12 immutable S _is;
13 Object o;
14 immutable Object io;
16 auto a = [pi, ipi];
17 auto b = [ai, iai];
18 auto c = [s, _is];
19 auto d = [o, io];
21 auto e = [A.a, B.b];