Bug 16795 – Allow taking address of 'scope' variable in some cases
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-11-26T01:43:45Z
Last change time
2018-03-04T03:27:36Z
Keywords
safe
Assigned to
No Owner
Creator
Walter Bright
Comments
Comment #0 by bugzilla — 2016-11-26T01:43:45Z
See https://github.com/dlang/dmd/pull/6253
int* q;
scope int* p;
scope int** pp = &q; // ok
pp = &p; // error
The last line should be allowed, because pp has a smaller lifetime than p.