[Issue 20156] New: Wrong error about local variable escape

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 23 13:24:04 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=20156

          Issue ID: 20156
           Summary: Wrong error about local variable escape
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dfj1esp02 at sneakemail.com

struct A
{
        int[] b;
}
inout(int[]) f1(ref inout A);
void f2(inout A src)
{
        inout A c=src;
        inout(int[])[] a;
        a~=f1(c);
}

onlineapp.d(10): Error: copying f1(c) into allocated memory escapes a reference
to local variable c

--


More information about the Digitalmars-d-bugs mailing list