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

          Issue ID: 17790
           Summary: [scope] Escaping pointer possible through array of
                    aggregates
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: safe
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: mathias.l...@sociomantic.com

Compile with -dip1000, the following compiles but shouldn't:

```
struct Foo { int* p; }

void main () @safe
{
    int* ptr = bar().p;
    assert(ptr !is null);
}

Foo bar () @safe
{
    int i;
    Foo[] arr = [ Foo(&i) ];
    return arr[0];
}
```

--

Reply via email to