[Issue 15305] std.manip.bitfields generate bogous code

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Nov 16 03:10:14 PST 2015


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

Lionello Lunesu <lio+bugzilla at lunesu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lio+bugzilla at lunesu.com

--- Comment #1 from Lionello Lunesu <lio+bugzilla at lunesu.com> ---
The generated setter for alice is wrong:

@property void alice(bool v) @safe pure nothrow @nogc { if (v) _alice_bob |=
1U;else _alice_bob &= ~1U;}

and it's wrong because the &=~1U would clear not just the first bit, but bits
32-64 as well. This in turn because of the code in myToString, which picks the
smallest type suffix, "U" in this case.

--


More information about the Digitalmars-d-bugs mailing list