New user self-registration is disabled due to spam. For an account please email bugs-admin@lists.llvm.org with your e-mail address and full name.

Bug 15861 - INVOKE ambiguously implemented (result_of and __invoke)
Summary: INVOKE ambiguously implemented (result_of and __invoke)
Status: RESOLVED FIXED
Alias: None
Product: libc++
Classification: Unclassified
Component: All Bugs (show other bugs)
Version: unspecified
Hardware: PC Linux
: P normal
Assignee: Howard Hinnant
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-28 06:54 PDT by hivemaster
Modified: 2013-05-07 18:41 PDT (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description hivemaster 2013-04-28 06:54:29 PDT
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.
Comment 1 Howard Hinnant 2013-05-07 18:41:46 PDT
Thanks for narrowing this bug report down to such a concise test case.

Fix committed revision 181377.