[LLVMbugs] [Bug 19921] New: Additional overloads of std::complex should not be used

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 2 07:09:33 PDT 2014


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

            Bug ID: 19921
           Summary: Additional overloads of std::complex should not be
                    used
           Product: libc++
           Version: unspecified
          Hardware: All
               URL: http://melpon.org/wandbox/permlink/yoRo9G7H3H71T2uA
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: kariya_mitsuru at hotmail.com
                CC: llvmbugs at cs.uiuc.edu, mclow.lists at gmail.com
    Classification: Unclassified

The sample code below should cause compilation error but it is compiled
successfully by clang + libc++.

===============================================
#include <iostream>
#include <complex>

struct S {
    S(double x) : x(x) {}
    operator double() { return x; }
    double x;
};

int main()
{
    std::cout << std::arg(S(-10)) << std::endl;
}
===============================================

According to C++11 standard [cmplx.over], I think that additional overloads
should not be used for the argument that is implicitly convertible to an
arithmetic type.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140602/1cf7bd7c/attachment.html>


More information about the llvm-bugs mailing list