Thread overview
[Issue 8914] Wrong `escaping reference` error on returning static array
May 24, 2015
John Colvin
Jul 21, 2017
Vladimir Panteleev
Dec 17, 2022
Iain Buclaw
May 24, 2015
https://issues.dlang.org/show_bug.cgi?id=8914

John Colvin <john.loughran.colvin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.loughran.colvin@gmail.
                   |                            |com

--- Comment #1 from John Colvin <john.loughran.colvin@gmail.com> ---
This is still happening.

Workaround is to create a temporary and hope the compiler elides it.

--
July 21, 2017
https://issues.dlang.org/show_bug.cgi?id=8914

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=17076

--- Comment #2 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
Test case above no longer fails to compile since 2.074.0 (https://github.com/dlang/dmd/pull/6420), however, adding an indirection to the parameter type still shows the error:

int*[2] f(int*[2] arr...)
{ return arr; }
// Error: returning `arr` escapes a reference to variadic parameter `arr`

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=8914

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3

--