gcc/testsuite/g++.dg/template/ptrmem12.C
raw| 1 | // Copyright (C) 2005 Free Software Foundation, Inc. |
| 2 | // Contributed by Nathan Sidwell 17 Mar 2005 <[email protected]> |
| 3 | |
| 4 | // PR 20465 |
| 5 | // Origin: Matthias Klose <[email protected]> |
| 6 | // Andrew Pinski <[email protected]> |
| 7 | |
| 8 | template <class _Ret, class _Tp> |
| 9 | void mem_fun_ref(_Ret (_Tp::*__f)()); |
| 10 | |
| 11 | struct A { |
| 12 | double f(); |
| 13 | }; |
| 14 | |
| 15 | void h () |
| 16 | { |
| 17 | mem_fun_ref(&A::f); |
| 18 | } |
| 19 | |
| 20 | template <class T> |
| 21 | void f() |
| 22 | { |
| 23 | mem_fun_ref(&A::f); |
| 24 | } |
| 25 | |
| 26 | void g() |
| 27 | { |
| 28 | f<int>(); |
| 29 | } |