[LLVMbugs] [Bug 11734] New: When assigning a real number to complex one, zero out the imaginary part

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jan 9 22:58:27 PST 2012


http://llvm.org/bugs/show_bug.cgi?id=11734

             Bug #: 11734
           Summary: When assigning a real number to complex one, zero out
                    the imaginary part
           Product: libc++
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: radford at blackbean.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 7859
  --> http://llvm.org/bugs/attachment.cgi?id=7859
Patch to fix assigning a real to a complex number.

The following incorrectly prints (5,4).  Patch attached.

int main(int c, char **v)
{
    std::complex<int> x(3,4);
    x = 5;
    std::cout << x << "\n";
    return 0;
}

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list