aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C
blob: 70ac25eb2777b66162fe92b4e232e859bef6084c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// { dg-do link  }

template<class T,class T1>
int connect_to_method(T* receiver,
                      int (T1::*method)()) 
{ 
  return (receiver->*method)();
}

class Gtk_Container
{
public:
  int remove_callback() { return 1; }
  void remove_callback(int);
  int f();
};

int Gtk_Container::f() 
{
  return connect_to_method(this, &Gtk_Container::remove_callback);
}

int main()
{
  Gtk_Container gc;
  if (gc.f () != 1)
    return 1;
}