This was fixed once back in 2.062, and now it's back again in 2.065! See: https://issues.dlang.org/show_bug.cgi?id=8913 http://bugzilla.gdcproject.org/show_bug.cgi?id=24 This is blocking MinGW port for GDC 2.065 merge.
PR that fixed 8913: https://github.com/D-Programming-Language/dmd/pull/1382 PR that reverted changed and re-introduced this problem: https://github.com/D-Programming-Language/dmd/pull/2888 Now it's interesting that 7175 was raised before 8913 and the fix that went into 8913. Oh well, I'll set this as a blocks anyhow.
Infact, regardless of whether or not this blocks mingw builds, it is reproducible on all targets. This is a *serious* bug.
If it doesn't have a test case or assert in dmd it's probably not going to stay fixed.
If there's a way to distinguish between different kinds of type in dmd's backend, you could throw in some tree checking. Such as: Assignments, left and right types are compatible. Comparisons, left and right types are compatible. Returns, return value type and function return type are compatible. Conditions, condition is a scalar type. Of course, you don't need this sort of checking in dmd release builds. :)
https://github.com/D-Programming-Language/dmd/pull/3662
This is also blocking the next binary release of gdc.
(In reply to yebblies from comment #3) > If it doesn't have a test case or assert in dmd it's probably not going to > stay fixed. It's going in the gdc testsuite. :)
https://github.com/D-Programming-Language/dmd/commit/ec3bfe03ae96712cbe0ce5dca86eb926bcb2e1e0 https://github.com/D-Programming-Language/dmd/pull/3662
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6dd50d5c296dea9b565a5f2754c249d4f6db5141 fix Issue 12900 - Wrong code in IfStatement condition Expression https://github.com/D-Programming-Language/dmd/commit/d664daebede34c6bf913af43f26c1d9673203414 Merge pull request #3685 from 9rnsr/fix12900 More conservative fix for issue 12900 - Wrong code in IfStatement condition Expression