| 1 |
/* TEST_OUTPUT: |
| 2 |
--- |
| 3 |
fail_compilation/pull12941.d(110): Error: `pull12941.foo` called with argument types `(int*)` matches multiple overloads exactly: |
| 4 |
fail_compilation/pull12941.d(101): `pull12941.foo(return ref scope int* p)` |
| 5 |
and: |
| 6 |
fail_compilation/pull12941.d(102): `pull12941.foo(return out scope int* p)` |
| 7 |
fail_compilation/pull12941.d(111): Error: function `bar` is not callable using argument types `(int)` |
| 8 |
fail_compilation/pull12941.d(111): cannot pass argument `1` of type `int` to parameter `return scope int* p` |
| 9 |
fail_compilation/pull12941.d(104): `pull12941.bar(return scope int* p)` declared here |
| 10 |
fail_compilation/pull12941.d(112): Error: function `abc` is not callable using argument types `(int)` |
| 11 |
fail_compilation/pull12941.d(112): cannot pass rvalue argument `1` of type `int` to parameter `return ref int* p` |
| 12 |
fail_compilation/pull12941.d(105): `pull12941.abc(return ref int* p)` declared here |
| 13 |
--- |
| 14 |
*/ |
| 15 |
|
| 16 |
/*********************************/ |
| 17 |
// Tests for https://github.com/dlang/dmd/pull/12941 |
| 18 |
|
| 19 |
#line 100 |
| 20 |
|
| 21 |
int* foo(ref scope return int* p); |
| 22 |
int* foo(out scope return int* p); |
| 23 |
|
| 24 |
int* bar(scope return int* p); |
| 25 |
int* abc(ref return int* p); |
| 26 |
|
| 27 |
void test() |
| 28 |
{ |
| 29 |
int* p; |
| 30 |
foo(p); |
| 31 |
bar(1); |
| 32 |
abc(1); |
| 33 |
} |