MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / ice12501.d
blob2c45c8a359daff644682534b16b20c597dfdbd52
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice12501.d(31): Error: function `ice12501.foo(int value)` is not callable using argument types `(int, int)`
5 fail_compilation/ice12501.d(31): expected 1 argument(s), not 2
6 fail_compilation/ice12501.d(31): Error: function `ice12501.foo(int value)` is not callable using argument types `(int, int)`
7 fail_compilation/ice12501.d(31): expected 1 argument(s), not 2
8 fail_compilation/ice12501.d(45): Error: template instance `ice12501.reduce!(foo, foo).reduce!(Tuple!(int, int), int[])` error instantiating
9 ---
12 struct Tuple(T...)
14 alias Types = T;
15 T field;
16 alias field this;
18 Tuple!A tuple(A...)(A args) { return typeof(return)(args); }
20 template reduce(fun...)
22 auto reduce(Args...)(Args args)
24 alias seed = args[0];
25 alias r = args[1];
26 Args[0] result = seed;
27 for (; r.length != 0; r = r[1..$])
29 foreach (i, Unused; Args[0].Types)
31 result[i] = fun[i](result[i], r[0]);
34 return result;
38 int foo(int value)
40 return value;
43 void main()
45 reduce!(foo, foo)(tuple(0, 0), [ 1 ]);