[Issue 20809] return statement might access memory from destructed temporary

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Aug 9 07:01:30 UTC 2022


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

Walter Bright <bugzilla at digitalmars.com> changed:

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

--- Comment #14 from Walter Bright <bugzilla at digitalmars.com> ---
(In reply to vitamin from comment #13)
> This bug still exists and it depends on existence of dtor in struct:

It now produces the errors:

test.d(19): Error: address of variable `__slFoo3` assigned to `foo` with longer
lifetime
test.d(20): Error: `Bar(1).i` is not an lvalue and cannot be modified

But the other manifestations of the problem still compile without error.

--


More information about the Digitalmars-d-bugs mailing list