Mercurial > projects > dstress
changeset 1402:4e11e483dbb6
[Issue 1016] CTFE fails with recursive functions
Don Clugston <clugdbug@yahoo.com.au>
2007-03-02
http://d.puremagic.com/issues/show_bug.cgi?id=1016
author | thomask |
---|---|
date | Thu, 08 Mar 2007 16:26:42 +0000 |
parents | b1d7b8a8c466 |
children | 9b84c2acf9e3 |
files | compile/c/const_43_A.d compile/c/const_43_B.d compile/c/const_43_C.d compile/c/const_43_D.d |
diffstat | 4 files changed, 84 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /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 <clugdbug@yahoo.com.au> +// @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);
--- /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 <clugdbug@yahoo.com.au> +// @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);
--- /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 <clugdbug@yahoo.com.au> +// @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));
--- /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 <clugdbug@yahoo.com.au> +// @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));