d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail10534.d
blobb5bb67c26786e5e01e653a93de5dc559737a477d
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail10534.d(28): Error: illegal operator `+` for `a` of type `int delegate()`
5 fail_compilation/fail10534.d(28): Error: illegal operator `+` for `b` of type `int delegate()`
6 fail_compilation/fail10534.d(29): Error: illegal operator `-` for `a` of type `int delegate()`
7 fail_compilation/fail10534.d(29): Error: illegal operator `-` for `b` of type `int delegate()`
8 fail_compilation/fail10534.d(30): Error: illegal operator `/` for `a` of type `int delegate()`
9 fail_compilation/fail10534.d(30): Error: illegal operator `/` for `b` of type `int delegate()`
10 fail_compilation/fail10534.d(31): Error: illegal operator `*` for `a` of type `int delegate()`
11 fail_compilation/fail10534.d(31): Error: illegal operator `*` for `b` of type `int delegate()`
12 fail_compilation/fail10534.d(36): Error: illegal operator `+` for `a` of type `int function()`
13 fail_compilation/fail10534.d(36): Error: illegal operator `+` for `b` of type `int function()`
14 fail_compilation/fail10534.d(37): Error: illegal operator `-` for `a` of type `int function()`
15 fail_compilation/fail10534.d(37): Error: illegal operator `-` for `b` of type `int function()`
16 fail_compilation/fail10534.d(38): Error: illegal operator `/` for `a` of type `int function()`
17 fail_compilation/fail10534.d(38): Error: illegal operator `/` for `b` of type `int function()`
18 fail_compilation/fail10534.d(39): Error: illegal operator `*` for `a` of type `int function()`
19 fail_compilation/fail10534.d(39): Error: illegal operator `*` for `b` of type `int function()`
20 ---
23 void main()
26 int delegate() a = ()=>5;
27 int delegate() b = ()=>5;
28 auto c1 = a + b; // passes (and will crash if c1() called)
29 auto c2 = a - b; // passes (and will crash if c2() called)
30 auto c3 = a / b; // a & b not of arithmetic type
31 auto c4 = a * b; // a & b not of arithmetic type
34 int function() a = ()=>5;
35 int function() b = ()=>5;
36 auto c1 = a + b;
37 auto c2 = a - b;
38 auto c3 = a / b;
39 auto c4 = a * b;