[Issue 13902] Compiler allows escaping the address of part of a local

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Dec 27 15:41:23 PST 2014


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

--- Comment #1 from Andrei Alexandrescu <andrei at erdani.com> ---
One more simple case, equivalent in fact because statically-sized arrays behave
like structs:

ref int lun() {
    int a[42];
    return a[5];
}

This should also be disallowed directly.

--


More information about the Digitalmars-d-bugs mailing list