summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/net37.C
blob: 35f3bca40399f495ffa2c83efd872e1c4543e0d2 (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
32
33
34
35
36
37
38
39
40
// { dg-do run  }
class B {
public:
    int bi;
    void bProc ( void ) { bi = 39; }
  };

class D : public B {
public:
    int di;
    void dProc (void ){ di = 42; }
  };

typedef void (B::*BPROC)(void);
typedef void (D::*DPROC)(void);

union AFX_PMSG {
public:

  AFX_PMSG () {}
  AFX_PMSG ( BPROC bpr ) { bfn = bpr ; }

  operator BPROC() { return bfn; }

  BPROC bfn;
  DPROC dfn;
};


int main(int argc, char *argv[]) {
  B b;
  D d;

  BPROC    bpr = &B::bProc;
  AFX_PMSG pmsg(bpr);

  BPROC ppr = pmsg;

  return 0;
}