# HG changeset patch # User thomask # Date 1164477187 0 # Node ID 672b0632b05cd5442afb20c064d72c707f06dfe0 # Parent 23b89cbbe1055b261e143f696c72beebd361e975 infinite loop in gdc-0.19 with tempaltes rm 2006-10-04 news:eg14oj$4vh$4@digitaldaemon.com diff -r 23b89cbbe105 -r 672b0632b05c compile/t/template_48_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_48_B.d Sat Nov 25 17:53:07 2006 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ rm +// @date@ 2006-10-04 +// @uri@ news:eg14oj$4vh$4@digitaldaemon.com +// @desc@ infinite loop in gdc-0.19 with tempaltes + +module dstress.compile.t.template_48_B; + +template TFoo(int v : 1){ + const int TFoo = 1; +} + +template TFoo(int v){ + const int TFoo = v * TFoo!(v-1); +} + +static assert(TFoo!(4) == 24); diff -r 23b89cbbe105 -r 672b0632b05c nocompile/t/template_48_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/t/template_48_A.d Sat Nov 25 17:53:07 2006 +0000 @@ -0,0 +1,22 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ rm +// @date@ 2006-10-04 +// @uri@ news:eg14oj$4vh$4@digitaldaemon.com +// @desc@ infinite loop in gdc-0.19 with tempaltes + +// __DSTRESS_ELINE__ 19 + +module dstress.nocompile.t.template_48_A; + +template TFoo(int v : 1){ + const int TFoo = 1; +} + +template TFoo(int v){ + const int TFoo = v * TFoo!(v-1).TFoo; +} + +static assert(TFoo!(4) == 24);