[Issue 2809] Wrong constant folding for unsigned shift

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Aug 9 01:41:12 UTC 2020


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

Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla at digitalmars.com
         Resolution|---                         |INVALID

--- Comment #8 from Walter Bright <bugzilla at digitalmars.com> ---
Since operands always undergo integral promotions, this behavior is expected
and correct. The idea is that the expressions will compute the same value as
the equivalent C expression in order to enable simple conversion of C code to D
code.

See:

https://dlang.org/spec/type.html#integer-promotions
https://dlang.org/spec/type.html#usual-arithmetic-conversions

--


More information about the Digitalmars-d-bugs mailing list