Mercurial > projects > dstress
view run/t/template_32_F.d @ 1514:891196dcfc3a
[Issue 1068] stack corruption with mixins and function templates
Tomasz Stachowiak <h3r3tic@mat.uni.torun.pl>
2007-03-19
http://d.puremagic.com/issues/show_bug.cgi?id=1068
author | thomask |
---|---|
date | Wed, 25 Apr 2007 17:46:32 +0000 |
parents | 902d2c168029 |
children |
line wrap: on
line source
// $HeadUR$ // $Date$ // $Author$ // @author@ Dave <Dave_member@pathlink.com> // @date@ 2006-03-18 // @uri@ news:dvgq34$22hv$1@digitaldaemon.com // @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=487 module dstress.run.t.template_32_F; template sum(double x){ static if (x <= 1.0){ const double sum = x; }else{ const double sum = x + sum!(x - 1.0); } } int main(){ double x = sum!(3.0); if(x != 6.0){ assert(0); } return 0; }