[Issue 17470] [scope] this has longer lifetime than this

2017-06-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17470

uplink.co...@googlemail.com changed:

   What|Removed |Added

 Resolution|WORKSFORME  |INVALID

--- Comment #4 from uplink.co...@googlemail.com ---
Apparently this error is valid because structs maybe moved.
in which case `s` would contain a dangling pointer.

--


[Issue 17470] [scope] this has longer lifetime than this

2017-06-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17470

Vladimir Panteleev  changed:

   What|Removed |Added

 Resolution|FIXED   |WORKSFORME

--- Comment #3 from Vladimir Panteleev  ---
(N.B. Use WORKSFORME instead of FIXED for bugs that shouldn't appear in the
changelog)

--


[Issue 17470] [scope] this has longer lifetime than this

2017-06-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17470

uplink.co...@googlemail.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from uplink.co...@googlemail.com ---
This is already fixed in the stable branch.

--


[Issue 17470] [scope] this has longer lifetime than this

2017-06-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17470

Vladimir Panteleev  changed:

   What|Removed |Added

 CC||thecybersha...@gmail.com

--- Comment #1 from Vladimir Panteleev  ---
I think the compiler is correct in issuing the error, though the error message
might need improvement. The problem is that you are creating an internal
pointer to the struct, which is forbidden. Since structs are value types,
constructing an instance of X on the stack, then returning it, will cause the s
field to refer to invalid memory.

--


[Issue 17470] [scope] this has longer lifetime than this

2017-06-05 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17470

uplink.co...@googlemail.com changed:

   What|Removed |Added

   Assignee|nob...@puremagic.com|uplink.co...@googlemail.com
Summary|[scope] this has longer |[scope] this has longer
   |lifetime then this  |lifetime than this

--