Jump to page: 1 2
Thread overview
[Issue 17117] erroneous "escaping reference to local variable"
[Issue 17117] auto ref "escaping reference to local variable"
Jan 24, 2017
John Colvin
Jan 24, 2017
John Colvin
Jan 24, 2017
Daniel Nielsen
Jan 25, 2017
Walter Bright
Jan 25, 2017
Walter Bright
[Issue 17117] [REG2.073] erroneous "escaping reference to local variable"
Jan 25, 2017
Martin Krejcirik
Jan 28, 2017
Martin Krejcirik
Jun 14, 2017
Martin Krejcirik
January 24, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |john.loughran.colvin@gmail.
                   |                            |com
           Hardware|x86_64                      |All
                 OS|Linux                       |All
           Severity|enhancement                 |regression

--- Comment #1 from John Colvin <john.loughran.colvin@gmail.com> ---
I suspect this is the same bug, seeing it's the same error in similar circumstances regressed across the same release.

This worked fine in 2.072.2 and now fails in 2.073:

ref int foo(return ref int s)
{
    return s;
}

int fail()
{
    int s;
    return foo(s); // Error: escaping reference to local variable s
}

int ok()
{
    int s;
    s = foo(s);
    return s;
}


Changed to regression because it's broken correct code.

--
January 24, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|auto ref "escaping          |erroneous "escaping
                   |reference to local          |reference to local
                   |variable"                   |variable"

--
January 24, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

Andrei Alexandrescu <andrei@erdani.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei@erdani.com

--- Comment #2 from Andrei Alexandrescu <andrei@erdani.com> ---
Robert's code seems to work on https://dpaste.dzfl.pl (2.073), but John's does not. Also, John's code has no ostensible escape, so the bug report stands.

--
January 24, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

Daniel Nielsen <goxryz@gmail.com> changed:

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

--- Comment #3 from Daniel Nielsen <goxryz@gmail.com> ---
Both fail on dpaste after enabling the unittest checkbox.

--
January 25, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

Walter Bright <bugzilla@digitalmars.com> changed:

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

--
January 25, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
I could not duplicate the error with HEAD. But I put in a test case for it anyway.

https://github.com/dlang/dmd/pull/6488

--
January 25, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

Martin Krejcirik <mk@krej.cz> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|erroneous "escaping         |[REG2.073] erroneous
                   |reference to local          |"escaping reference to
                   |variable"                   |local variable"

--
January 28, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

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

https://github.com/dlang/dmd/commit/4a4dcf23830e9066a70cb1c381d97306f2bb5bbc fix Issue 17117 - erroneous 'escaping reference to local variable'

https://github.com/dlang/dmd/commit/ad85be95ea42be37ccae2ad6133b0b058929fe3e Merge pull request #6488 from WalterBright/fix17117

fix Issue 17117 - erroneous 'escaping reference to local variable'

--
January 28, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

--- Comment #6 from Martin Krejcirik <mk@krej.cz> ---
Walter, can you fix this in 2.073 too ?

--
February 24, 2017
https://issues.dlang.org/show_bug.cgi?id=17117

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

https://github.com/dlang/dmd/commit/4a4dcf23830e9066a70cb1c381d97306f2bb5bbc fix Issue 17117 - erroneous 'escaping reference to local variable'

https://github.com/dlang/dmd/commit/ad85be95ea42be37ccae2ad6133b0b058929fe3e Merge pull request #6488 from WalterBright/fix17117

--
« First   ‹ Prev
1 2