https://issues.dlang.org/show_bug.cgi?id=18054
Dlang Bot <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull --- Comment #2 from Dlang Bot <[email protected]> --- @MoonlightSentinel created dlang/dmd pull request #13285 "Fix 18054 - Use toBool instead of toInteger when const-folding cast(b…" fixing this issue: - Fix 18054 - Use toBool instead of toInteger when const-folding cast(bool) `RealExp` / `ComplexExp` may hold values that don't have a matching integer value (unlike `IntegerExp`). Switching to `toBool` ensures proper boolean conversion according to the current type. Teh test output shown below (before this change) was caused by the invalid const-folding for floating point literals. ``` float: 1 == 0 double: 1 == 0 real: 1 == 0 ifloat: 1 == 0 idouble: 1 == 0 ireal: 1 == 0 cfloat: 1 == 0 cdouble: 1 == 0 creal: 1 == 0 ``` https://github.com/dlang/dmd/pull/13285 --
