www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18315] New: wrong code for `i > 0`

https://issues.dlang.org/show_bug.cgi?id=18315

          Issue ID: 18315
           Summary: wrong code for `i > 0`
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ag0aep6g gmail.com

Found by kdevel who posted to D.learn:
https://forum.dlang.org/post/nbcmkpeyfoqljulmfmsg forum.dlang.org

----
void main ()
{
   int i = int.min;
   bool b = i > 0;
   assert(!b); /* fails */
}
----

--
Jan 27