[Issue 475] New: DMD segfault on recursive variadic template

Thomas Kuehne thomas-dloop at kuehne.cn
Thu Nov 23 02:54:09 PST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail at puremagic.com schrieb am 2006-11-02:
> http://d.puremagic.com/issues/show_bug.cgi?id=475

> The following code crashes DMD on linux:
>
> template recMove(int i, X...)
> {
>   void recMove()
>     {
>       X[i] = X[i+1];
>       // I know the code is logically wrong, should test (i+2 < X.length)
>       static if(i+1 < X.length) recMove!(i+1, X);
>     }
> }
>
> void main()
> {
>   int a, b;
>   recMove!(0, a, b);
> }

Added to DStress as
http://dstress.kuehne.cn/nocompile/t/tuple_01_A.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFFZYJOLK5blCcjpWoRAolDAJ9QbilfZjWl13MDgUwXw0GlxH62vgCfTMK2
IvfT8FNbSFcw65rGnkKlOyk=
=tbQ7
-----END PGP SIGNATURE-----



More information about the Digitalmars-d-bugs mailing list