Mercurial > projects > dstress
changeset 1277:06c7337c4bd6
[Issue 495] New: ICE passing variadic arglist to another variadic template
Bill Baxter <wbaxter@gmail.com>
2006-11-12
news:bug-495-3@http.d.puremagic.com/issues/
author | thomask |
---|---|
date | Sat, 23 Dec 2006 19:47:18 +0000 |
parents | 3054c226a571 |
children | b644bef333ff |
files | compile/t/tuple_08_A.d run/t/tuple_08_B.d |
diffstat | 2 files changed, 49 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/tuple_08_A.d Sat Dec 23 19:47:18 2006 +0000 @@ -0,0 +1,20 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter <wbaxter@gmail.com> +// @date@ 2006-11-12 +// @uri@ news:bug-495-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 495] New: ICE passing variadic arglist to another variadic template + +module dstress.compile.t.tuple_08_A; + +template g(T...){ + const g = T.length; +} + +template f(T...){ + const f = g!(T); +} + +static assert(f!(7, 5.6f) == 2);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/tuple_08_B.d Sat Dec 23 19:47:18 2006 +0000 @@ -0,0 +1,29 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter <wbaxter@gmail.com> +// @date@ 2006-11-12 +// @uri@ news:bug-495-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 495] New: ICE passing variadic arglist to another variadic template + +module dstress.run.t.tuple_08_B; + +template g(T...){ + int g(){ + return T.length; + } +} + +template f(T...){ + int f(T t){ + return g!(T)(); + } +} + +int main(){ + if(f(7, 5.6f) != 2){ + assert(0); + } + return 0; +}