1 /* REQUIRED_ARGS: -preview=dip1000
4 fail_compilation/fail20183.d(1016): Error: function `fail20183.addr(return ref int b)` is not callable using argument types `(int)`
5 fail_compilation/fail20183.d(1016): cannot pass rvalue argument `S(0).i` of type `int` to parameter `return ref int b`
6 fail_compilation/fail20183.d(1017): Error: address of struct temporary returned by `s()` assigned to longer lived variable `q`
12 // https://issues.dlang.org/show_bug.cgi?id=20183
16 int* addr(return ref int b) { return &b; }
27 int* p = addr(S().i); // struct literal
28 int* q = addr(s().i); // struct temporary
34 fail_compilation/fail20183.d(1107): Error: address of struct temporary returned by `s()` assigned to longer lived variable `this.ptr`
45 ptr = addr(s().i); // struct literal