]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gdc.test/fail_compilation/test15191.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / fail_compilation / test15191.d
CommitLineData
b4c522fa
IB
1/* TEST_OUTPUT:
2---
5fee5ec3 3fail_compilation/test15191.d(17): Error: cannot take address of `ref return` of `foo()` in `@safe` function `bar`
b4c522fa
IB
4---
5*/
6
7
8// https://issues.dlang.org/show_bug.cgi?id=15191
9
10ref int foo(return ref int s)@safe
11{
12 return s;
13}
14
15int* bar(return ref int s) @safe
16{
17 return &foo(s);
18}