comparison run/s/struct_initialization_12_D.d @ 1558:d40d75fcd5c5

[Issue 1268] Struct literals try to initialize static arrays of non-static structs incorrectly Matti Niemenmaa <deewiant@gmail.com> 2007-06-15 http://d.puremagic.com/issues/show_bug.cgi?id=1268
author thomask
date Mon, 23 Jul 2007 18:47:01 +0000
parents
children
comparison
equal deleted inserted replaced
1557:de3b217ccd1e 1558:d40d75fcd5c5
1 // $HeadURL$
2 // $Date$
3 // $Author$
4
5 // @author@ Matti Niemenmaa <deewiant@gmail.com>
6 // @date@ 2007-06-15
7 // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1268
8 // @desc@ [Issue 1268] Struct literals try to initialize static arrays of non-static structs incorrectly
9
10 module dstress.run.s.struct_initialization_12_D;
11
12 typedef int I = 13;
13
14 struct S{
15 I[5] x;
16 }
17
18 int main(){
19 S s = S();
20 for(size_t i = 0; i < 5; i++){
21 if(13 != s.x[i]){
22 assert(0);
23 }
24 }
25 return 0;
26 }