Mercurial > projects > dstress
changeset 1450:2322c29c00be
[Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned
Mark Guidarelli <guido@grumpy-cat.com>
2007-03-31
http://d.puremagic.com/issues/show_bug.cgi?id=1088
author | thomask |
---|---|
date | Wed, 04 Apr 2007 20:33:42 +0000 |
parents | 6666662e4363 |
children | 623963e374c5 |
files | reporter.txt run/s/struct_initialization_10_A.d run/s/struct_initialization_10_B.d |
diffstat | 3 files changed, 55 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/reporter.txt Wed Apr 04 20:29:33 2007 +0000 +++ b/reporter.txt Wed Apr 04 20:33:42 2007 +0000 @@ -104,6 +104,7 @@ Madeleine Freudenberg <madou@madou.org> Manfred Nowak <svv1999@hotmail.com> Manuel König <manuelk89@gmx.net> +Mark Guidarelli <guido@grumpy-cat.com> marko <tm030127d@galeb.etf.bg.ac.yu> Markus Dangl <sky@quit-clan.de> Matti Niemenmaa (Deewiant) <deewiant@gmail.com>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/struct_initialization_10_A.d Wed Apr 04 20:33:42 2007 +0000 @@ -0,0 +1,27 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Mark Guidarelli <guido@grumpy-cat.com> +// @date@ 2007-03-31 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1088 +// @desc@ [Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned + +module dstress.run.s.struct_initialization_10_A; + +struct S{ + new(size_t size){ + return (new void[size]).ptr; + } + + int i = 0x12_AB_CD_00; +} + +int main(){ + S* s = new S(); + if(0x12_AB_CD_00 != s.i){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/struct_initialization_10_B.d Wed Apr 04 20:33:42 2007 +0000 @@ -0,0 +1,27 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Mark Guidarelli <guido@grumpy-cat.com> +// @date@ 2007-03-31 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1088 +// @desc@ [Issue 1088] structs allocated with a struct allocator will not have default initializer values assigned + +module dstress.run.s.struct_initialization_10_B; + +struct S{ + new(size_t size){ + return (new void[size]).ptr; + } + + int i = 0x12_AB_CD_00; +} + +int main(){ + S s; + if(0x12_AB_CD_00 != s.i){ + assert(0); + } + + return 0; +}