2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.ext / addrfunc4.C
blob05312e4e5e7fa07e12058b367f42eb6e5d6250ad
1 // { dg-do run  }
2 // { dg-options "-fms-extensions" }
3 // Test that an object-dependent reference to a member function can be
4 // used to produce a pointer to member function, as in VC++.
5 // Contributed by Jason Merrill <jason@cygnus.com>
7 struct A
9   int  f(int a) { return 0; }
10   void f(int a, int b) { }
13 typedef int  (A::* pmf1)(int);
14 typedef void (A::* pmf2)(int, int);
16 int main()
18   A a;
19   pmf1 fn1;
20   pmf2 fn2;
22   fn1 = a.f; 
23   fn1 = (pmf1)a.f;
24   fn2 = (pmf2)a.f;