# HG changeset patch # User thomask # Date 1173371202 0 # Node ID 4e11e483dbb67d75bfeb117c19cc71af6d37efb8 # Parent b1d7b8a8c46625aca7c090b84586aa0090a0b864 [Issue 1016] CTFE fails with recursive functions Don Clugston 2007-03-02 http://d.puremagic.com/issues/show_bug.cgi?id=1016 diff -r b1d7b8a8c466 -r 4e11e483dbb6 compile/c/const_43_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/const_43_A.d Thu Mar 08 16:26:42 2007 +0000 @@ -0,0 +1,22 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston +// @date@ 2007-03-02 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1016 +// @desc@ [Issue 1016] CTFE fails with recursive functions + +module dstress.comile.c.const_43_A; + +bool bar(int i){ + bool state = false; + if(i > 10){ + state = true; + bool ignore = bar(i-1); + } + return state; +} + +const bool a = bar(11); +static assert(a); diff -r b1d7b8a8c466 -r 4e11e483dbb6 compile/c/const_43_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/const_43_B.d Thu Mar 08 16:26:42 2007 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston +// @date@ 2007-03-02 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1016 +// @desc@ [Issue 1016] CTFE fails with recursive functions + +module dstress.comile.c.const_43_B; + +bool bar(int i){ + bool state = false; + if(i > 10){ + state = true; + } + return state; +} + +const bool a = bar(11); +static assert(a); diff -r b1d7b8a8c466 -r 4e11e483dbb6 compile/c/const_43_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/const_43_C.d Thu Mar 08 16:26:42 2007 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston +// @date@ 2007-03-02 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1016 +// @desc@ [Issue 1016] CTFE fails with recursive functions + +module dstress.comile.c.const_43_C; + +bool bar(int i){ + bool state = false; + if(i > 10){ + state = true; + bool ignore = bar(i-1); + } + return state; +} + +static assert(bar(11)); diff -r b1d7b8a8c466 -r 4e11e483dbb6 compile/c/const_43_D.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/const_43_D.d Thu Mar 08 16:26:42 2007 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston +// @date@ 2007-03-02 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1016 +// @desc@ [Issue 1016] CTFE fails with recursive functions + +module dstress.comile.c.const_43_D; + +bool bar(int i){ + bool state = false; + if(i > 10){ + state = true; + } + return state; +} + +static assert(bar(11));