MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail125.d
blob93d176dd4e23e943115dbde1fb2a90e1a42ce8a6
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail125.d(15): Error: array index `[2]` is outside array bounds `[0 .. 2]`
5 fail_compilation/fail125.d(18): Error: template instance `fail125.main.recMove!(1, a, b)` error instantiating
6 fail_compilation/fail125.d(25): instantiated from here: `recMove!(0, a, b)`
7 ---
8 */
11 template recMove(int i, X...)
13 void recMove()
15 X[i] = X[i+1];
16 // I know the code is logically wrong, should test (i+2 < X.length)
17 static if (i+1 < X.length)
18 recMove!(i+1, X);
22 void main()
24 int a, b;
25 recMove!(0, a, b);