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: [email protected]
Reporter: [email protected]
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.
--