www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 20150] New: -dip1000 defeated by pure

https://issues.dlang.org/show_bug.cgi?id=20150

          Issue ID: 20150
           Summary: -dip1000 defeated by pure
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: safe
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ag0aep6g gmail.com

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).

--
Aug 22 2019