D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7367 - wrong char comparison result
Summary: wrong char comparison result
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2012-01-24 20:07 UTC by timon.gehr
Modified: 2012-01-25 17:09 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description timon.gehr 2012-01-24 20:07:07 UTC
With DMD 2.058head the following code asserts during runtime:
void main(){
    char a = '\x00';
    char b = '\xFF';
    int c = b;
    assert(a < c);          // ok
    assert(a < b);          // fail
    assert(a < cast(int)b); // fail
}
Comment 1 github-bugzilla 2012-01-25 17:08:11 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/3cc9b41641964c415209296d074146346331209a
fix Issue 7367 - wrong char comparison result
Comment 2 github-bugzilla 2012-01-25 17:08:28 UTC
Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/db4de5151064d13717185d01320fc495d73f71de
fix Issue 7367 - wrong char comparison result