February 04, 2019
https://issues.dlang.org/show_bug.cgi?id=19646

          Issue ID: 19646
           Summary: Initialization of globals not checked for @safe
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody@puremagic.com
          Reporter: bugzilla@digitalmars.com

Reported by Luís Marques:

import std.stdio;

@safe:

const x = 42;
int* y = cast(int*) &x;

void main()
{
    *y = 7;
    writeln(x); // prints 42
}

--