http://d.puremagic.com/issues/show_bug.cgi?id=8396
Summary: wrong order of evaluation for tuple expansion in function arguments Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: d...@dawgfoto.de --- Comment #0 from d...@dawgfoto.de 2012-07-17 06:03:32 PDT --- cat > bug.d << CODE struct Tuple { int _a, _b; } Tuple foo() { return Tuple(1, 2); } extern(C) int bar(int a, int b) { return b - a; } void main() { assert(bar(foo().tupleof) == 1); } CODE dmd -run bug ---- Arguments for extern(C) function are currently evaluated from right to left (Bug 6620). The temporary for the result of foo is evaluated with the leftmost argument, therefore the second argument is uninitialized when calling an extern(C) function. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------