www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17450] New: escaping delegate context pointer not detected

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

          Issue ID: 17450
           Summary: escaping delegate context pointer not detected for
                    member functions
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com

alias dg_t = void delegate();

struct S {
     safe dg_t foo1(ref S s) {
        return &s.bar; // should detect an error
    }
     safe dg_t foo2(ref S s) {
        return &bar; // should detect an error
    }
     safe void bar();
}

--
May 28