This should fail to compile with dip1000: ref int test(ref scope return int* p) { return *p; } p should be 'return ref` and `scope`, but the compiler interprets it as `ref` and `return scope` and passes it.
@WalterBright updated dlang/dmd pull request #12817 "fix Issue 21868 - DIP1000 doesn't catch pointer to struct temporary" fixing this issue: - fix Issue 22108 - DIP1000 parameter mistakenly interpreted as return scope instead of scope https://github.com/dlang/dmd/pull/12817
What's happening is the value of p is being returned, and `return ref` and `scope` should prevent the value of p being returned.
dlang/dmd pull request #12817 "fix Issue 22108 - parameter mistakenly interpreted as return scope instead of scope" was merged into master: - 815570c3e6085e9b062e1bf57c8951a734de166b by Walter Bright: fix Issue 22108 - DIP1000 parameter mistakenly interpreted as return scope instead of scope https://github.com/dlang/dmd/pull/12817