[Issue 19645] New: Default parameters not checked for @safe
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Feb 4 01:36:20 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19645
Issue ID: 19645
Summary: Default parameters not checked for @safe
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
Reported by ag0aep6g:
import std.stdio;
@safe:
immutable x = 42;
void main()
{
*f() = 7;
writeln(x); // 42
writeln(*&x); // 7
}
int* f(int* y = cast(int*) &x) { return y; }
--
More information about the Digitalmars-d-bugs
mailing list