d: Merge upstream dmd 4d1bfcf14, druntime 9ba9a6ae, phobos c0cc5e917.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / ice9540.d
blobce705078ac0c2791180e9173a94e4a5ca81b1228
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice9540.d(35): Error: function `ice9540.A.test.AddFront!(this, f).AddFront.dg(int _param_0)` is not callable using argument types `()`
5 fail_compilation/ice9540.d(35): too few arguments, expected `1`, got `0`
6 fail_compilation/ice9540.d(26): Error: template instance `ice9540.A.test.AddFront!(this, f)` error instantiating
7 ---
8 */
10 template Tuple(E...) { alias E Tuple; }
11 alias Tuple!(int) Args;
13 void main() {
14 (new A).test ();
17 void test1 (int delegate (int) f) { f (-2); }
19 class A
21 int f (int a) {
22 return a;
25 void test () {
26 test1 (&AddFront!(this, f));
30 template AddFront (alias ctx, alias fun) {
31 auto AddFront(Args args) {
32 auto dg (Args dgArgs) {
33 return fun (dgArgs);
35 dg.ptr = ctx;
36 return dg(args);