aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.pt/ptrmem4.C
blob: 139be9235507042fbd13ea0a1292d01d5ef134e1 (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
// Build don't run:

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;
}