Issue 20150 - -dip1000 defeated by pure
Summary: -dip1000 defeated by pure
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords: accepts-invalid, pull, safe
: 21291 (view as issue list)
Depends on:
Blocks:
 
Reported: 2019-08-22 10:12 UTC by ag0aep6g
Modified: 2021-08-26 08:00 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ag0aep6g 2019-08-22 10:12:09 UTC
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).
Comment 1 Dlang Bot 2020-03-15 10:09:41 UTC
@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
Comment 2 ag0aep6g 2020-11-29 22:15:26 UTC
I'm changing the title back. `pure` does not imply `scope` parameters.
Comment 3 Dlang Bot 2020-11-29 22:22:54 UTC
@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
Comment 4 Dennis 2021-05-12 13:23:08 UTC
*** Issue 21291 has been marked as a duplicate of this issue. ***
Comment 5 Dennis 2021-05-12 13:26:23 UTC
*** Issue 21912 has been marked as a duplicate of this issue. ***
Comment 6 Dlang Bot 2021-05-14 10:34:04 UTC
@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
Comment 7 Dlang Bot 2021-08-18 11:59:52 UTC
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
Comment 8 Dlang Bot 2021-08-26 08:00:01 UTC
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