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];
}