| 1 |
// https://issues.dlang.org/show_bug.cgi?id=22151 |
| 2 |
/* |
| 3 |
TEST_OUTPUT: |
| 4 |
--- |
| 5 |
fail_compilation/fail22151.d(17): Error: function `test` is not an lvalue and cannot be modified |
| 6 |
fail_compilation/fail22151.d(18): Error: function `test2` is not an lvalue and cannot be modified |
| 7 |
fail_compilation/fail22151.d(21): Error: function pointed to by `fp` is not an lvalue and cannot be modified |
| 8 |
fail_compilation/fail22151.d(24): Error: function pointed to by `ff` is not an lvalue and cannot be modified |
| 9 |
fail_compilation/fail22151.d(27): Error: operator `==` is not defined for function types |
| 10 |
fail_compilation/fail22151.d(28): Error: operator `is` is not defined for function types |
| 11 |
fail_compilation/fail22151.d(29): Error: comparison is not defined for function types |
| 12 |
--- |
| 13 |
*/ |
| 14 |
|
| 15 |
void test() |
| 16 |
{ |
| 17 |
*&test = *&test; |
| 18 |
*&test2 = *&test; |
| 19 |
|
| 20 |
void function() fp; |
| 21 |
*fp = *fp; |
| 22 |
|
| 23 |
auto ff = &test2; |
| 24 |
*ff = *&test2; |
| 25 |
|
| 26 |
// https://github.com/dlang/dmd/issues/18281 |
| 27 |
const c = *fp == *fp; |
| 28 |
const d = *fp is *fp; |
| 29 |
const e = *fp < *fp; |
| 30 |
} |
| 31 |
|
| 32 |
void test2(); |