D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7294 - [Regression] No warning when escaping local reference type variables
Summary: [Regression] No warning when escaping local reference type variables
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-15 06:39 UTC by Martin Nowak
Modified: 2015-06-09 04:41 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2012-01-15 06:39:05 UTC
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 github-bugzilla 2012-02-01 17:23:12 UTC
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