# HG changeset patch # User thomask # Date 1173611937 0 # Node ID 26bcea00b742ed013e86c31d491e19e942f60296 # Parent 8eb7223bbe9a645918fbb91f8a33db2c78139c92 [Issue 1026] dmd SEGV when checking length of Tuple elements when length == 0 Russ Lewis 2007-03-05 http://d.puremagic.com/issues/show_bug.cgi?id=1026 diff -r 8eb7223bbe9a -r 26bcea00b742 compile/t/tuple_18_F.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/tuple_18_F.d Sun Mar 11 11:18:57 2007 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Russ Lewis +// @date@ 2007-03-05 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1026 +// @desc@ [Issue 1026] dmd SEGV when checking length of Tuple elements when length == 0 + +module dstress.compile.t.tuple_18_F; + +template Tuple(Elements...) { + alias Elements Tuple; +} + +struct Foo{ +} + +struct Bar{ + Tuple!(Foo) elements; +} + +static assert(Bar.elements.length == 1); diff -r 8eb7223bbe9a -r 26bcea00b742 nocompile/t/tuple_18_G.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/t/tuple_18_G.d Sun Mar 11 11:18:57 2007 +0000 @@ -0,0 +1,22 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Russ Lewis +// @date@ 2007-03-05 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=1026 +// @desc@ [Issue 1026] dmd SEGV when checking length of Tuple elements when length == 0 + +// __DSTRESS_ELINE__ 22 + +module dstress.nocompile.t.tuple_18_G; + +template Tuple(Elements...) { + alias Elements Tuple; +} + +struct Bar{ + Tuple!() elements; +} + +static assert(Bar.elements[0]);