<html>
    <head>
      <base href="http://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 --- - INVOKE ambiguously implemented (result_of and __invoke)"
   href="http://llvm.org/bugs/show_bug.cgi?id=15861">15861</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>INVOKE ambiguously implemented (result_of and __invoke)
          </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>hhinnant@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>hivemaster@hotmail.de
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The following example doesn't compile because of the ambiguous overloads of
`__invoke`:

#include <type_traits>

struct wat { wat& operator*() { return *this; } void foo(); };

int main(){
  using type = std::result_of<decltype(&wat::foo)(wat)>::type;
}

The standard (indirectly) states in 20.8.1 [func.require] p1 that the second
bullet only applies if the first bullet does not, through the restrictions on
the type of `t1`. The same problem appears with member data pointers (bullets 3
and 4).

One possible resolution is to remove the respective overloads from overload
resolution depending on whether the type of `t1` is a type derived from the
class of the member 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>