Bug 5557 – [64-Bit] FP (alignment?) issues with Rvalues

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2011-02-10T08:11:00Z
Last change time
2011-02-11T01:25:35Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2011-02-10T08:11:52Z
import std.stdio; struct Temp { this(float ctorPar) { } this(double ctorPar) { } void buggy(float val) const { writeln(val); } void buggy2(double val) const { writeln(val); } void working(real val) const { writeln(val); } } void main() { Temp(7.f).buggy(2.); //!<- val == ctorPar Temp(7.f).buggy2(0.); //!<- val is some mixup of ctorPar Temp(7.f).working(2.); Temp(7.).buggy(2.); //!<- val == 0 Temp(7.).buggy2(2.); //!<- val == ctorPar Temp(7.).working(2.); } ------ Only the functions taking a real gets called with the correct parameter value. The other two are influenced by the value to the ctor.
Comment #1 by bugzilla — 2011-02-11T01:25:35Z