| 1 |
// PR c++/53009 |
| 2 |
// { dg-do compile { target c++11 } } |
| 3 |
|
| 4 |
template<typename T, T> class function_proxy; |
| 5 |
|
| 6 |
template<typename Return, typename Obj, Return(*func)(Obj)> |
| 7 |
struct function_proxy<Return(*)(Obj), func> |
| 8 |
{ |
| 9 |
static void wrapper(){ } |
| 10 |
}; |
| 11 |
|
| 12 |
template<typename CT, CT> class member_helper; |
| 13 |
|
| 14 |
template<typename Class, void(Class::*fun)()> |
| 15 |
struct member_helper<void(Class::*)(), fun> |
| 16 |
{ |
| 17 |
static void as_free(Class& obj){ } |
| 18 |
|
| 19 |
static void worker(){ |
| 20 |
(void) function_proxy<decltype(&as_free), &as_free>::wrapper; |
| 21 |
} |
| 22 |
}; |
| 23 |
|
| 24 |
struct Test |
| 25 |
{ |
| 26 |
void test(){ } |
| 27 |
}; |
| 28 |
|
| 29 |
int main() |
| 30 |
{ |
| 31 |
member_helper<decltype(&Test::test), &Test::test>::worker(); |
| 32 |
} |