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

Vladimir Panteleev <thecybersha...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |thecybersha...@gmail.com

--- Comment #1 from Vladimir Panteleev <thecybersha...@gmail.com> ---
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.

--

Reply via email to