[Issue 22988] no short-circuiting when constant folding ternary operator

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Apr 5 09:17:31 UTC 2022


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

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Error: shift by -1 is       |no short-circuiting when
                   |outside the range `0..31`   |constant folding ternary
                   |                            |operator

--- Comment #5 from Dennis <dkorpel at live.nl> ---
Ah, thanks for clearing that up. I think this test illustrates the problem
best:
```
enum a = false && (1 << -1); // passes
enum b = false ? (1 << -1) : 0; // fails

```
I've updated the title

--


More information about the Digitalmars-d-bugs mailing list