changeset 1238:672b0632b05c

infinite loop in gdc-0.19 with tempaltes rm <roel.mathys@gmail.com> 2006-10-04 news:eg14oj$4vh$4@digitaldaemon.com
author thomask
date Sat, 25 Nov 2006 17:53:07 +0000
parents 23b89cbbe105
children ee2da7e06729
files compile/t/template_48_B.d nocompile/t/template_48_A.d
diffstat 2 files changed, 42 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /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 <roel.mathys@gmail.com>
+// @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);
--- /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 <roel.mathys@gmail.com>
+// @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);