gcc/testsuite/gdc.test/fail_compilation/fail7173.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail7173.d(23): Error: expression `b1._a.opBinary(b2._a).fun()` is `void` and has no value |
| 5 | --- |
| 6 | */ |
| 7 | struct A{ |
| 8 | |
| 9 | A opBinary(string op)(A a){ A rt; return rt; } |
| 10 | |
| 11 | void fun(){ } |
| 12 | } |
| 13 | |
| 14 | struct B{ |
| 15 | |
| 16 | A _a; |
| 17 | alias _a this; |
| 18 | } |
| 19 | |
| 20 | |
| 21 | void main(){ |
| 22 | |
| 23 | B b1, b2, b3; b3 = (b1 - b2).fun(); |
| 24 | } |