On 12/7/2016 3:52 AM, Stefan Koch wrote:
That is why I said unambiguously.
Ok.
We will neither warn or error in the above case, because p could have been
assigned to.
Only if we directly read from something uninitialized will we error.
The dmd optimizer does global data flow analysis:
int fn(int y)
{
int x = void;
++x;
return x+y;
}
----
dmd -c test7 -O
test7.d(4): Error: variable x used before set
----
https://github.com/dlang/dmd/blob/master/src/backend/gother.c#L418
dmd's back end has done global data flow analysis since about 1985, even though
popular opinion holds that clang invented it :-)