https://issues.dlang.org/show_bug.cgi?id=22215
Issue ID: 22215
Summary: [dip1000] scope analysis does not respect @system or
@trusted
Product: D
Version: D2
Hardware: x86
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: [email protected]
Reporter: [email protected]
This does not compile with -dip1000:
```
int* f()
{ int x = 42;
return &x;
}
```
There is a workaround that compiles:
```
int* f()
{ int x = 42;
auto wannaBePointer = cast(size_t)&x;
return cast(typeof(return)) wannaBePointer;
}
```
But according to the spec, only `@safe` code must analyzed with -dip1000 so
this workaround should not be required.
--