import std.math;
void main()
{
double x[] = new double[1];
double a = x[0];
assert(a == 0);
assert(x[0] == 0);
assert(isnan(a));
assert(isnan(x[0]));
}
No assert fails in the code above - and one hour is gone off my life.
Comment #1 by andrei — 2009-06-19T06:10:23Z
I noticed that the bug manifests itself only when building with -O.
Comment #2 by fvbommel — 2009-06-19T06:27:42Z
This is present in both 1.045 and 2.030; setting version to 1.045 because D1 updates seem to be more likely to be forgotten for dual-version bugs (and because it was unset).