]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/gdc.test/compilable/test19097.d
d: Import dmd b8384668f, druntime e6caaab9, phobos 5ab9ad256 (v2.098.0-beta.1)
[thirdparty/gcc.git] / gcc / testsuite / gdc.test / compilable / test19097.d
1 /* REQUIRED_ARGS: -preview=dip1000
2 */
3
4 // Related to: https://github.com/dlang/dmd/pull/8504
5
6 @safe:
7
8 void betty()(ref int* r, return scope int* p)
9 {
10 r = p; // infer `scope` for r
11 }
12
13 void boop()(ref int* r, scope int* p)
14 {
15 r = p; // infer `scope` for r, `return` for p
16 }
17
18 void foo(scope int* pf)
19 {
20 scope int* rf;
21 betty(rf, pf);
22 boop(rf, pf);
23 }