https://issues.dlang.org/show_bug.cgi?id=17725
Issue ID: 17725
Summary: [scope] escape from nested function to enclosing local
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
>From Rainer:
void test() @safe {
int* p;
struct T {
int a;
}
void escape(ref T t) @safe {
p = &t.a; // should not compile
}
{
T t;
escape(t);
}
auto bug = *p;
}
Compile with -dip1000
--
