[Issue 12251] Use of BigInts in triple operator too

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 25 10:07:51 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12251


safety0ff.bugz <safety0ff.bugz at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |safety0ff.bugz at gmail.com


--- Comment #1 from safety0ff.bugz <safety0ff.bugz at gmail.com> 2014-02-25 10:07:46 PST ---
I think this is a wrong-code bug and not a phobos enhancement. If we manually
change the the BigInts to lvalues we see the correct output.

------ Example -----
import std.stdio, std.bigint;
bool b;
void main() {
    int x1, x2;
    (b ? x1 : x2) += 1;
    writeln(x1, " ", x2);

    BigInt y1, y2;
    (b ? y1 : y2) += 1;
    writeln(y1, " ", y2);

    BigInt z1, z2;
    *(b ? &z1 : &z2) += 1;
    writeln(z1, " ", z2);
}
------ Output -----
0 1
0 0
0 1

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list