<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Implement DR 1137 - Real return types for std::conj(float) and friends"
   href="https://llvm.org/bugs/show_bug.cgi?id=27741">27741</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Implement DR 1137 - Real return types for std::conj(float) and friends
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hfinkel@anl.gov
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>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.

  <a href="http://lwg.github.io/issues/lwg-defects.html#1137">http://lwg.github.io/issues/lwg-defects.html#1137</a>

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++.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>