[Issue 5557] New: [64-Bit] FP (alignment?) issues with Rvalues

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 10 08:14:20 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5557

           Summary: [64-Bit] FP (alignment?) issues with Rvalues
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: dawg at dawgfoto.de


--- Comment #0 from dawg at dawgfoto.de 2011-02-10 08:11:52 PST ---
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.

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


More information about the Digitalmars-d-bugs mailing list