1 // https://bugzilla.gdcproject.org/show_bug.cgi?id=218 2 // { dg-do compile } 3 4 struct S218a 5 { thisS218a6 this(int* pdata_) 7 { 8 pdata = pdata_; 9 } 10 opIndexAssignS218a11 void opIndexAssign(int, size_t) { } 12 int* pdata; 13 }; 14 15 struct S218 16 { getS218aS21817 S218a getS218a() 18 { 19 return S218a(data.ptr); 20 } 21 22 int[] data; 23 int[] tab2; 24 }; 25 f()26S218 f() 27 { 28 S218 r; 29 30 for(int i = 0; i < 1; ++i) 31 r.getS218a()[0] = 0; 32 33 return r; 34 } 35 36 S218 var; 37 this()38static this() 39 { 40 var = f(); 41 } 42