[Issue 17430] New: [scope] delegate can escape context ptr

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed May 24 23:17:31 PDT 2017


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

          Issue ID: 17430
           Summary: [scope] delegate can escape context ptr
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: code at dawg.eu

cat > bug.d << CODE
struct S { void foo() {} }

void delegate() bar() @safe
{
    S s;
    auto dg = &s.foo; // should be inferred as scope
    return dg;
}
CODE

dmd -c -dip1000 bug

--


More information about the Digitalmars-d-bugs mailing list