Thread overview
[Issue 21291] Array literal that escapes scope is allocated on stack
Oct 04, 2020
ag0aep6g
Apr 23, 2021
Dechcaudron
May 12, 2021
Dennis
October 04, 2020
https://issues.dlang.org/show_bug.cgi?id=21291

ag0aep6g <ag0aep6g@gmail.com> changed:

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

--- Comment #1 from ag0aep6g <ag0aep6g@gmail.com> ---
(In reply to Dennis from comment #0)
> It seems to be important that the array literal is in a pure static member function, though it might be possible to reduce the example further.

Duplicate of issue 20150? `-preview=dip1000` pretty much doesn't check `pure` functions at all, at the moment.

--
April 23, 2021
https://issues.dlang.org/show_bug.cgi?id=21291

Dechcaudron <dechcaudron+issues.dlang@pm.me> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dechcaudron+issues.dlang@pm
                   |                            |.me

--- Comment #2 from Dechcaudron <dechcaudron+issues.dlang@pm.me> ---
This has also happened to me, no idea it could be due to -dip1000. So removing the compiler switch enables one to work around the issue (other than code not being suitable for @nogc)?

--
May 12, 2021
https://issues.dlang.org/show_bug.cgi?id=21291

Dennis <dkorpel@live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #3 from Dennis <dkorpel@live.nl> ---


*** This issue has been marked as a duplicate of issue 20150 ***

--