March 15, 2020
https://issues.dlang.org/show_bug.cgi?id=20149

Rainer Schuetze <r.sagitario@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r.sagitario@gmx.de

--- Comment #23 from Rainer Schuetze <r.sagitario@gmx.de> ---
(In reply to Walter Bright from comment #22)
> 1. how are you compiling it?

I guess with -preview=dip1000

> 2. what do you expect to happen compared with what does happen? (I compile it and no errors are emitted)

This is the described problem. It should produce an error, a pointer to stack allocated memory is escaping.

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

Dennis <dkorpel@live.nl> changed:

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

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

--- Comment #24 from Dlang Bot <dlang-bot@dlang.rocks> ---
@dkorpel created dlang/dmd pull request #12689 "Fix issue 22027, 20149 - inout doesn't imply return" fixing this issue:

- fix issue 22027, 20149 - inout doesn't imply return

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

--
February 14, 2022
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #25 from Walter Bright <bugzilla@digitalmars.com> ---
A further simplified test case:

  @safe:

  struct S {
  //inout(char)* slice() inout return /* gives correct error */
    inout(char)* slice() inout          /* no error */
    {
        return &buf;
    }

    char buf;
  }

  char* fun() {
    S sb;
    return sb.slice();
  }

Note that if slice() were made as a static function, with sb passed by ref as the first parameter, the compilation gives the correct error. Hence it's related to the `this` being a special case.

--
February 15, 2022
https://issues.dlang.org/show_bug.cgi?id=20149

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[DIP1000] Local data        |[DIP1000] Local data
                   |escapes `inout` method if   |escapes inout method if not
                   |not decorated with `return` |decorated with return

--
February 15, 2022
https://issues.dlang.org/show_bug.cgi?id=20149

--- Comment #26 from Dlang Bot <dlang-bot@dlang.rocks> ---
@WalterBright updated dlang/dmd pull request #13658 "fix Issue 20149 - [DIP1000] Local data escapes inout method if not de…" fixing this issue:

- fix Issue 20149 - [DIP1000] Local data escapes inout method if not decorated with return

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

--
February 25, 2022
https://issues.dlang.org/show_bug.cgi?id=20149

Dlang Bot <dlang-bot@dlang.rocks> changed:

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

--- Comment #27 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #13658 "fix Issue 20149 - [DIP1000] Local data escapes inout method if not de…" was merged into master:

- e0b6ea806a3a3bd0f1f4dff4d6662d5286b86889 by Walter Bright:
  fix Issue 20149 - [DIP1000] Local data escapes inout method if not decorated
with return

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

--
1 2 3 4
Next ›   Last »