From 554fd8c5195424bdbcabf5de30fdc183aba391bd Mon Sep 17 00:00:00 2001 From: upstream source tree Date: Sun, 15 Mar 2015 20:14:05 -0400 Subject: obtained gcc-4.6.4.tar.bz2 from upstream website; verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository. --- gcc/testsuite/g++.old-deja/g++.mike/p8155.C | 148 ++++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.mike/p8155.C (limited to 'gcc/testsuite/g++.old-deja/g++.mike/p8155.C') diff --git a/gcc/testsuite/g++.old-deja/g++.mike/p8155.C b/gcc/testsuite/g++.old-deja/g++.mike/p8155.C new file mode 100644 index 000000000..79384717c --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.mike/p8155.C @@ -0,0 +1,148 @@ +// { dg-do run } +// prms-id: 8155 + +int fail = 1; + +class CMainWindow; +class CFrameWnd; +class CWnd; +class CCmdTarget; + +typedef void (CCmdTarget::*AFX_PMSG)( void); +typedef void (CWnd::*AFX_PMSGW)( void); + +struct AFX_MSGMAP_ENTRY { + unsigned int nMessage; + AFX_PMSG pfn; +}; + +struct AFX_MSGMAP { + const AFX_MSGMAP* pBaseMap; + const AFX_MSGMAP_ENTRY* lpEntries; +}; + +class CCmdTarget { +public: + CCmdTarget(); +private: + static AFX_MSGMAP_ENTRY _messageEntries[]; +protected: + static const AFX_MSGMAP messageMap; + virtual const AFX_MSGMAP* GetMessageMap() const; +}; + +const AFX_MSGMAP CCmdTarget::messageMap = { + 0, &CCmdTarget::_messageEntries[0] +}; + +const AFX_MSGMAP* CCmdTarget::GetMessageMap() const { + return &CCmdTarget::messageMap; +} + +AFX_MSGMAP_ENTRY CCmdTarget::_messageEntries[] = +{ + { 0, 0 } +}; + +CCmdTarget :: CCmdTarget() { } + +class CWnd : public CCmdTarget { +public: + CWnd(); + +protected: + void OnPaint(); +private: + static AFX_MSGMAP_ENTRY _messageEntries[]; +protected: + static const AFX_MSGMAP messageMap; + virtual const AFX_MSGMAP* GetMessageMap() const; +}; + +CWnd :: CWnd() { +} + +void CWnd :: OnPaint() { +} + +const AFX_MSGMAP* CWnd ::GetMessageMap() const { + return & CWnd ::messageMap; +} +const AFX_MSGMAP CWnd ::messageMap = { + & CCmdTarget ::messageMap, & CWnd ::_messageEntries[0] + }; +AFX_MSGMAP_ENTRY CWnd ::_messageEntries[] = { + {0, (AFX_PMSG)0 } }; + +class CFrameWnd : public CWnd { +public: + CFrameWnd(); +protected: +private: + static AFX_MSGMAP_ENTRY _messageEntries[]; +protected: + static const AFX_MSGMAP messageMap; + virtual const AFX_MSGMAP* GetMessageMap() const; +}; + +CFrameWnd :: CFrameWnd() { } + +const AFX_MSGMAP* CFrameWnd ::GetMessageMap() const { + return & CFrameWnd ::messageMap; +} +const AFX_MSGMAP CFrameWnd ::messageMap = { + & CWnd ::messageMap, & CFrameWnd ::_messageEntries[0] + }; +AFX_MSGMAP_ENTRY CFrameWnd ::_messageEntries[] = { + {0, (AFX_PMSG)0 } }; + +class CMainWindow : public CFrameWnd { +public: + CMainWindow(); + void OnPaint(); + void callProc(); +private: + static AFX_MSGMAP_ENTRY _messageEntries[]; +protected: + static const AFX_MSGMAP messageMap; + virtual const AFX_MSGMAP* GetMessageMap() const; +}; + +CMainWindow :: CMainWindow() +{ +} +void CMainWindow :: OnPaint() +{ + fail = 0; +} + +void CMainWindow :: callProc() +{ + const AFX_MSGMAP* pMessageMap; + const AFX_MSGMAP_ENTRY *lpEntry; + + pMessageMap = GetMessageMap(); + lpEntry = pMessageMap->lpEntries; + + if( lpEntry->nMessage == 100) { + (this->*lpEntry->pfn)(); + } +} + +const AFX_MSGMAP* CMainWindow ::GetMessageMap() const { + return & CMainWindow ::messageMap; +} +const AFX_MSGMAP CMainWindow ::messageMap = { + & CFrameWnd ::messageMap, & CMainWindow ::_messageEntries[0] + }; +AFX_MSGMAP_ENTRY CMainWindow ::_messageEntries[] = { + { 100, (AFX_PMSG)(AFX_PMSGW)(void (CWnd::*)(void))&CMainWindow::OnPaint }, + {0, (AFX_PMSG)0 } +}; + +int main( int argc, char **argv) { + CMainWindow myWindow; + + myWindow.callProc(); + return fail; +} -- cgit v1.2.3