[Issue 20084] return by auto ref unsafe - and different code for inout ref and ref.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 14 09:34:36 UTC 2020


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

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla at digitalmars.com

--- Comment #3 from Walter Bright <bugzilla at digitalmars.com> ---
Reduced test case:

struct W() {
    int value;
    @safe ref int front() return { return value; }
}

@safe ref int get(W!() v) {
    return v.front;   // should produce error message with -dip1000
}

--


More information about the Digitalmars-d-bugs mailing list