[Issue 19754] cast() sometimes yields lvalue, sometimes yields rvalue

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 30 16:16:36 UTC 2019


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

kinke <kinke at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
                 CC|                            |kinke at gmx.net
         Resolution|FIXED                       |---

--- Comment #13 from kinke <kinke at gmx.net> ---
It does yield an lvalue now with v2.087, but a wrong one (temporary, I guess):

void main()
{
    const x = 0;
    const p = &x;
    (cast() x) = 5; // wrongly const-folded to 0 = 5
    assert(*p == 5); // fails, still 0
}

--


More information about the Digitalmars-d-bugs mailing list