http://d.puremagic.com/issues/show_bug.cgi?id=3925

           Summary: Missed escaping reference of a local variable
           Product: D
           Version: 2.041
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-03-10 07:38:56 PST ---
This is a wrong program, and the compiler shows the right error messages, of x
and y escaping:


ref int foo(int x) {
    return x;
}
int* baz() {
    int y;
    return &y;
}
void main() {}

-------------------


But in the following case the compiler doesn't show an error:


ref int foo(ref int x) {
    return x;
}
ref int bar() {
    int x;
    return foo(x); // escaping reference of x
}
void main() {}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to