[PATCH] [libcxx] Fix result_of (and INVOKE) for member function pointers with ref qualifiers

Michel Morin mimomorin at gmail.com
Fri Nov 15 17:00:49 PST 2013


Since `__member_pointer_traits<MemFunPtr>::_ClassType` preserves the
ref qualifier
of `MemFunPtr`, the following `enable_if` (used in `__invoke`)

class = typename enable_if<
    is_member_function_pointer<typename remove_reference<_Fp>::type>::value
 && is_base_of<
        typename __member_pointer_traits<typename
remove_reference<_Fp>::type>::_ClassType
      , typename remove_reference<_A0>::type
    >::value
>::type

always fails when `_Fp` has a ref qualifier.
This behavior of `__invoke` is incorrect w.r.t. [func.require] p1 bullet 1.

A patch attached to fix this issue.
It also adds a test case.

(This patch is the same one as in PR17606
 http://llvm.org/bugs/show_bug.cgi?id=17606 .)


Regards,
Michel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix_invoke.patch
Type: application/octet-stream
Size: 2904 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131116/34cfa6a3/attachment.obj>


More information about the cfe-commits mailing list