Thread overview
[Issue 5212] no escape analysis for typesafe variadic function arguments
Sep 20, 2014
Martin Nowak
Sep 24, 2016
Martin Nowak
Apr 30, 2017
Nick Treleaven
Mar 03, 2018
Walter Bright
Jun 14, 2018
ag0aep6g
Jun 15, 2018
Artem Borisovskiy
Jun 15, 2018
Artem Borisovskiy
Mar 04, 2020
Walter Bright
September 20, 2014
https://issues.dlang.org/show_bug.cgi?id=5212

--- Comment #16 from Martin Nowak <code@dawg.eu> ---
We should probably enforce (or automatically) add scope to typesafe variadic
arguments.

--
September 24, 2016
https://issues.dlang.org/show_bug.cgi?id=5212

--- Comment #17 from Martin Nowak <code@dawg.eu> ---
(In reply to Martin Nowak from comment #16)
> We should probably enforce (or automatically) add scope to typesafe variadic
> arguments.

I guess enforcing an explicit scope annotation would make the deprecation a bit simpler, but not much.

--
April 30, 2017
https://issues.dlang.org/show_bug.cgi?id=5212

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |safe
                 CC|                            |nick@geany.org

--- Comment #18 from Nick Treleaven <nick@geany.org> ---
Mentioning -dip1000 so Walter finds this.

--
March 03, 2018
https://issues.dlang.org/show_bug.cgi?id=5212

Walter Bright <bugzilla@digitalmars.com> changed:

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

--- Comment #19 from Walter Bright <bugzilla@digitalmars.com> ---
https://github.com/dlang/dmd/pull/7976

--
March 03, 2018
https://issues.dlang.org/show_bug.cgi?id=5212

--- Comment #20 from github-bugzilla@puremagic.com ---
Commits pushed to master at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/be4ad4b744f1649f6b010b13a5cbf96582786c46 fix Issue 5212 - no escape analysis for typesafe variadic function arguments

https://github.com/dlang/dmd/commit/de449877d0dc9ba0eb2e799d7b178ebb6fe85c18 Merge pull request #7976 from WalterBright/fix5212

fix Issue 5212 - no escape analysis for typesafe variadic function ar…

--
June 14, 2018
https://issues.dlang.org/show_bug.cgi?id=5212

ag0aep6g <ag0aep6g@gmail.com> changed:

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

--- Comment #21 from ag0aep6g <ag0aep6g@gmail.com> ---
*** Issue 18980 has been marked as a duplicate of this issue. ***

--
June 15, 2018
https://issues.dlang.org/show_bug.cgi?id=5212

Artem Borisovskiy <kolos80@bk.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #22 from Artem Borisovskiy <kolos80@bk.ru> ---
The original code compiles and asserts with DMD v2.080.1

--
June 15, 2018
https://issues.dlang.org/show_bug.cgi?id=5212

--- Comment #23 from Artem Borisovskiy <kolos80@bk.ru> ---
And yes, I was able to compile the code with -dip1000

--
March 04, 2020
https://issues.dlang.org/show_bug.cgi?id=5212

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #24 from Walter Bright <bugzilla@digitalmars.com> ---
Compiling:
-----
@safe:
class Foo {
    int[] args;
    @safe this(int[] args_...) {
        args = args_;
    }
}
Foo foo() {
    return new Foo(1, 2, 3); // passes stack data to Foo
}
void main() {
    assert(foo().args == [1, 2, 3]);
}
----

with -preview=DIP1000 yields:

  test.d(5): Error: scope variable `args_` assigned to non-scope `this.args`

meaning the compiler is working correctly.

--