|
|
|
|
|
by WalterBright
1917 days ago
|
|
Doing what D does to detect references to expired stack frames would require some restructuring of C++'s semantics, which seems unlikely. For example, D can detect this error: @safe:
int* f(int* p) { return p; }
int* g() { int i; return f(&i); }
Compile with: dmd test -dip1000
and the result: Error: reference to local variable i assigned to non-scope parameter p calling test.f
|
|