<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 - std::to_address isn't SFINAE friendly"
   href="https://bugs.llvm.org/show_bug.cgi?id=44846">44846</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::to_address isn't SFINAE friendly
          </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>enhancement
          </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>cjdb.ns@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following example should compile, but causes an instantiation error.

```
#include <memory>

struct dummy {};

struct iterator {
        using element_type = dummy;
        int* operator->() const;
};

template<typename I>
concept passing = requires(I const& i) {
    std::to_address(i);
};

static_assert(not passing<iterator>);
```

Because `std::to_address` has a deduced return type, the concept `passing` must
instantiate `std::to_address`, which means that it ironically causes a hard
error when trying to check if the expression is well-formed (the concept is not
at fault here). Changing `std::to_address` to be SFINAE-friendly will be
necessary to implement `std::contiguous_iterator`.

Related issue: <a class="bz_bug_link 
          bz_status_RESOLVED  bz_closed"
   title="RESOLVED INVALID - SFINAE leaks through requires expression requirement"
   href="show_bug.cgi?id=44674">https://bugs.llvm.org/show_bug.cgi?id=44674</a></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>