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

--- Comment #3 from Walter Bright <[email protected]> ---
(In reply to Jonathan M Davis from comment #1)
>     int i;
>     int* foo() { return &i; }

should behave like:

    int* foo(int* p) { return p; }

and then the error is detected:

    int*[] b = [foo(&i)];

The [ ] puts things on the heap, where they escape.

--

Reply via email to