d: Merge dmd. druntime e770945277, phobos 6d6e0b9b9
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / pull12941.d
blobca78050e6acfed89fbd14a1167cb3c7b1f644747
1 /* TEST_OUTPUT:
2 ---
3 fail_compilation/pull12941.d(110): Error: `pull12941.foo` called with argument types `(int*)` matches both:
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 ---
16 /*********************************/
17 // Tests for https://github.com/dlang/dmd/pull/12941
19 #line 100
21 int* foo(ref scope return int* p);
22 int* foo(out scope return int* p);
24 int* bar(scope return int* p);
25 int* abc(ref return int* p);
27 void test()
29 int* p;
30 foo(p);
31 bar(1);
32 abc(1);