https://llvm.org/bugs/show_bug.cgi?id=27741

            Bug ID: 27741
           Summary: Implement DR 1137 - Real return types for
                    std::conj(float) and friends
           Product: libc++
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangb...@nondot.org
          Reporter: hfin...@anl.gov
                CC: llvm-bugs@lists.llvm.org, mclow.li...@gmail.com
    Classification: Unclassified

libc++, unlike libstdc++, does not implement DR 1137, which says that the
return type of std::conj(float) should be float, not std::complex<float>.

inline _LIBCPP_INLINE_VISIBILITY
complex<float>
conj(float __re)
{
    return complex<float>(__re);
}

The proposed resolution to DR 1137 was to add:

  All of the specified overloads shall have a return type which is the nested
value_type of the effectively cast arguments.

  http://lwg.github.io/issues/lwg-defects.html#1137

to 26.4.9, although I don't see that text in the standard itself - I'm not sure
what happened in that regard. libstdc++ has:

  // DR 1137.
  template<typename _Tp>
    inline typename __gnu_cxx::__promote<_Tp>::__type
    proj(_Tp __x)
    { return __x; }

  template<typename _Tp>
    inline typename __gnu_cxx::__promote<_Tp>::__type
    conj(_Tp __x)
    { return __x; }

We have code that, as a result of this, compiles with libstdc++, but not with
libc++.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to