# HG changeset patch # User thomask # Date 1175790800 0 # Node ID c41d70e10b6f7a7b93d7ceafcb276dff9a5b707b # Parent d74530a60502b6cc94d52a3e1e9b86374b48c7d9 [Issue 993] No constant folding for template value default arguments Don Clugston 2007-02-02 http://d.puremagic.com/issues/show_bug.cgi?id=993 diff -r d74530a60502 -r c41d70e10b6f run/t/template_58_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_58_A.d Thu Apr 05 16:33:20 2007 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston +// @date@ 2007-02-02 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=993 +// @desc@ [Issue 993] No constant folding for template value default arguments + +module dstress.run.t.template_58_A; + +const int x = 7; + +int a(int b = x * 2)(){ + return b + 1; +} + +int main() { + if(15 != a()){ + assert(0); + } + return 0; +} diff -r d74530a60502 -r c41d70e10b6f run/t/template_58_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_58_B.d Thu Apr 05 16:33:20 2007 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston +// @date@ 2007-02-02 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=993 +// @desc@ [Issue 993] No constant folding for template value default arguments + +module dstress.run.t.template_58_B; + +const int x = 7; + +int a(int b = x * 2)(){ + return b + 1; +} + +int main() { + if(15 != a!(14)()){ + assert(0); + } + return 0; +} diff -r d74530a60502 -r c41d70e10b6f run/t/template_58_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_58_C.d Thu Apr 05 16:33:20 2007 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston +// @date@ 2007-02-02 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=993 +// @desc@ [Issue 993] No constant folding for template value default arguments + +module dstress.run.t.template_58_C; + +const int x = 7 * 2; + +int a(int b = x)(){ + return b + 1; +} + +int main() { + if(15 != a!()()){ + assert(0); + } + return 0; +} diff -r d74530a60502 -r c41d70e10b6f run/t/template_58_D.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_58_D.d Thu Apr 05 16:33:20 2007 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston +// @date@ 2007-02-02 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=993 +// @desc@ [Issue 993] No constant folding for template value default arguments + +module dstress.run.t.template_58_D; + +int a(int b = 7 * 2)(){ + return b + 1; +} + +int main() { + if(15 != a()){ + assert(0); + } + return 0; +} diff -r d74530a60502 -r c41d70e10b6f run/t/template_58_E.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_58_E.d Thu Apr 05 16:33:20 2007 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston +// @date@ 2007-02-02 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=993 +// @desc@ [Issue 993] No constant folding for template value default arguments + +module dstress.run.t.template_58_E; + +int a(int b = 7 * 2)(){ + return b + 1; +} + +int main() { + if(15 != a()){ + assert(0); + } + return 0; +}