Debian Codegraph @

gcc/testsuite/gdc.test/compilable/returnscope_without_safe.d

raw
1 // Stack pointers are being escaped here, but without
2 // @safe and dip1000, it should still be allowed
3 // because return scope could have been inferred incorrectly,
4 // and it breaks existing code:
5 // https://issues.dlang.org/show_bug.cgi?id=23657
6
7 int* identity(return scope int* x);
8
9 auto identityAuto(int* x) => x;
10
11 int* f()
12 {
13 int x;
14 return identity(&x);
15 return identityAuto(&x);
16 }