[Issue 23064] wrong code generated for bitfield assignment to ?:
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Apr 28 11:09:43 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23064
Basile-z <b2.temp at gmx.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |b2.temp at gmx.com
--- Comment #1 from Basile-z <b2.temp at gmx.com> ---
After a brief discussion on IRC it seems that C does not allow the conditional
expression to be a lvalue, hence it could not be an assignment RHS.
>From http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf
---
The first operand is evaluated; there is a sequence point between its
evaluation and the
evaluation of the second or third operand (whichever is evaluated). The second
operand
is evaluated only if the first compares unequal to 0; the third operand is
evaluated only if
the first compares equal to 0; the result is the value of the second or third
operand
(whichever is evaluated), converted to the type described below.110)
[...]
110) A conditional expression does not yield an lvalue
---
that would not affect ImportC then.
--
More information about the Digitalmars-d-bugs
mailing list