Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.mike/p7626.C

raw
1 // { dg-do assemble }
2 // prms-id: 7626
3
4 int fail;
5
6 typedef unsigned int UINT;
7
8 class CObject{};
9
10 class CCmdTarget : public CObject {
11 };
12
13 typedef void (CCmdTarget::*AFX_PMSG)(void);
14
15 struct AFX_MSGMAP_ENTRY {
16 AFX_PMSG pfn;
17 };
18
19 class CWnd : public CCmdTarget {
20 public:
21 void OnMyMsg() { fail = 1; } // If this one is called, something is wrong.
22 static AFX_MSGMAP_ENTRY _messageEntries[];
23 };
24
25 typedef void (CWnd::*AFX_PMSGW)(void);
26
27 class CDialog : public CWnd
28 {
29 public:
30 void OnMyMsg() { }
31 static AFX_MSGMAP_ENTRY _messageEntries[];
32 };
33
34 AFX_MSGMAP_ENTRY CDialog ::_messageEntries[] = {
35 { (AFX_PMSG)(AFX_PMSGW)(void (CWnd::*)())&CDialog::OnMyMsg },
36 { (AFX_PMSG)0 }
37 };
38
39 int main() {
40 CDialog d;
41 (d.*((CDialog::_messageEntries)[0]).pfn)(); // This should call CDialog::OnMyMsg
42 return fail;
43 }