[Issue 15232] New: Escape analysis should be more sophisticated
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Wed Oct 21 15:58:05 PDT 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=15232
          Issue ID: 15232
           Summary: Escape analysis should be more sophisticated
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: timon.gehr at gmx.ch
Consider the following code:
void foo()@nogc{
    int x;
    struct S{ int bar()@nogc{ return x; } }
    S s;
}
Error: function foo @nogc function allocates a closure with the GC
No closure should be allocated here and in similar cases.
--
    
    
More information about the Digitalmars-d-bugs
mailing list