d: Merge upstream dmd 47871363d, druntime, c52e28b7, phobos 99e9c1b77.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail17927.d
blob410f307770661eead7096f158389aebfd53d2f73
1 /* REQUIRED_ARGS: -preview=dip1000
2 * TEST_OUTPUT:
3 ---
4 fail_compilation/fail17927.d(13): Error: scope variable `this` may not be returned
5 fail_compilation/fail17927.d(15): Error: scope variable `this` may not be returned
6 fail_compilation/fail17927.d(21): Error: scope variable `ptr` may not be returned
7 fail_compilation/fail17927.d(23): Error: scope variable `ptr` may not be returned
8 ---
9 */
10 // https://issues.dlang.org/show_bug.cgi?id=17927
12 struct String {
13 const(char)* mem1() const scope @safe { return ptr; }
14 // https://issues.dlang.org/show_bug.cgi?id=22027
15 inout(char)* mem2() inout scope @safe { return ptr; }
17 char* ptr;
21 const(char)* foo1(scope const(char)* ptr) @safe { return ptr; }
23 inout(char)* foo2(scope inout(char)* ptr) @safe { return ptr; }