Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.ext/addrfunc4.C

raw
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 <[email protected]>
6
7 struct A
8 {
9 int f(int a) { return 0; }
10 void f(int a, int b) { }
11 };
12
13 typedef int (A::* pmf1)(int);
14 typedef void (A::* pmf2)(int, int);
15
16 int main()
17 {
18 A a;
19 pmf1 fn1;
20 pmf2 fn2;
21
22 fn1 = a.f;
23 fn1 = (pmf1)a.f;
24 fn2 = (pmf2)a.f;
25 }