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