[Issue 11920] Rvalue aggregate contains lvalues

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Dec 17 21:08:28 UTC 2023


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

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at geany.org

--- Comment #10 from Nick Treleaven <nick at geany.org> ---
With dmd v2.106.0-rc.1, inside @safe and with -dip1000:

    foo().i = 5; // still allowed
    int* p = &foo().i; // error, address assigned to longer lived variable

Comment #3:

    foo(a[1]); // still allowed, should fail
    foo(b.i); // error, cannot pass rvalue, same for comment #4

--


More information about the Digitalmars-d-bugs mailing list