Bug 17795 – [scope] Scope errors not detected in ~= operation

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-08-30T19:01:20Z
Last change time
2017-10-16T09:57:44Z
Keywords
safe
Assigned to
No Owner
Creator
Walter Bright

Comments

Comment #0 by bugzilla — 2017-08-30T19:01:20Z
As reported by Mathias Lang: // Compiles with -dip1000, but should not void main () @safe { int* ptr = bar(); assert(ptr !is null); } int* bar () @safe { int i; int*[][] arr = new int*[][](1); arr[0] ~= &i; return arr[0][0]; }
Comment #1 by bugzilla — 2017-09-15T08:29:29Z
Comment #2 by github-bugzilla — 2017-09-25T14:22:48Z
Commit pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/8b3b0a40f27234ac3aba0f747b8278ad7a5ab3ca fix Issue 17795 - [scope] Scope errors not detected in ~= operation
Comment #3 by github-bugzilla — 2017-10-16T09:57:44Z
Commit pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/8b3b0a40f27234ac3aba0f747b8278ad7a5ab3ca fix Issue 17795 - [scope] Scope errors not detected in ~= operation