This is a spin-off from issue 19175. ---- int* escape(int* r) @safe pure { return r; } int* f() @safe { int x = 42; return escape(&x); /* Should not compile. */ } ---- Tested with v2.087.0 and v2.088.0-beta.1-46-g0459e34e (current git master).
@WalterBright created dlang/dmd pull request #10924 "fix Issue 20150 - -dip1000 return attribute must be explicit in pure …" fixing this issue: - fix Issue 20150 - -dip1000 return attribute must be explicit in pure functions https://github.com/dlang/dmd/pull/10924
I'm changing the title back. `pure` does not imply `scope` parameters.
@aG0aep6G created dlang/dmd pull request #12010 "fix Issue 20150 - -dip1000 defeated by pure" fixing this issue: - fix Issue 20150 - -dip1000 defeated by pure https://github.com/dlang/dmd/pull/12010
*** Issue 21291 has been marked as a duplicate of this issue. ***
*** Issue 21912 has been marked as a duplicate of this issue. ***
@nordlow created dlang/dmd pull request #12520 "Fix pure scope" fixing this issue: - fix Issue 20150 - -dip1000 return attribute must be explicit in pure functions https://github.com/dlang/dmd/pull/12520
dlang/dmd pull request #12010 "fix Issue 20150 - -dip1000 defeated by pure" was merged into master: - 5d5c2e3ca3814ea0064aa9241ab8ec938403aa2c by aG0aep6G: fix Issue 20150 - -dip1000 defeated by pure https://github.com/dlang/dmd/pull/12010
dlang/phobos pull request #8215 "Remove workaround for issue 20150" was merged into master: - 53086d4ffcb381467644e5159667b593cfdf8eb5 by dkorpel: remove workaround for issue 20150 https://github.com/dlang/phobos/pull/8215