<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - C++2a std::midpoint's "Constraints" are not implemented"
   href="https://bugs.llvm.org/show_bug.cgi?id=42037">42037</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>C++2a std::midpoint's "Constraints" are not implemented
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>arthur.j.odwyer@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>// <a href="https://godbolt.org/z/mAL4Sd">https://godbolt.org/z/mAL4Sd</a>
#include <numeric>
int a();
int b();
int main() {
    std::midpoint(a, b);
}

====

/c++/v1/numeric:554:52: error: arithmetic on pointers to the function type 'int
()'
    return __a + _VSTD::midpoint(ptrdiff_t(0), __b - __a);
                                               ~~~ ^ ~~~

According to N4810, std::midpoint for `T*` should be constrained to require `T`
to be a complete object type (not a function type, and not cv void either).

I'm fairly confident that no library code should ever try to constrain on
`is_pointer` without also asking whether it's an object pointer, function
pointer, member pointer, or void pointer. It might be worth auditing the entire
libc++ codebase for uses of `is_pointer`.</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>