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

--- Comment #14 from ag0aep6g <ag0ae...@gmail.com> ---
(In reply to kinke from comment #13)
> 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
> }

That code is invalid. Mutating x has undefined behavior.

--

Reply via email to