Bug 7294 – [Regression] No warning when escaping local reference type variables

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2012-01-15T06:39:00Z
Last change time
2015-06-09T04:41:31Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2012-01-15T06:39:05Z
Object foo() { scope obj = new Object; return obj; } ---- Introduced with: https://github.com/D-Programming-Language/dmd/commit/931100137ee60f5d269f6c0bcf2ae34d188d54db ExpStatement::scopeCode sets the noscope flag to mark that the destructor already ran. This prevents VarExp::checkEscape from emitting an error.
Comment #1 by github-bugzilla — 2012-02-01T17:23:12Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/28324c5c1226571f2ee96eebee5fd3ad09ebe031 fix Issue 7294 - [Regression] No warning when escaping local reference type variables