summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/pmf5.C
blob: 685801a8591a295ec04261f1e2b62606527e8088 (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
29
30
31
// Special g++ Options: -w

class A {
  int j;
};

class Space {
  int j;
};

typedef int (A::*pma)();

class B : public Space, virtual public A {
public:
  int i;
  int foo () {
    return i!=42;
  }
  B() {
    i = 42;
  }
};

int call_base (A* ap, pma pmf) {
  return (ap->*pmf)();
}

int main() {
  B b;
  return call_base ((A*)&b, (pma)&B::foo);
}