diff options
author | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
---|---|---|
committer | upstream source tree <ports@midipix.org> | 2015-03-15 20:14:05 -0400 |
commit | 554fd8c5195424bdbcabf5de30fdc183aba391bd (patch) | |
tree | 976dc5ab7fddf506dadce60ae936f43f58787092 /gcc/testsuite/g++.old-deja/g++.mike/p8155.C | |
download | cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2 cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz |
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
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.
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.mike/p8155.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.mike/p8155.C | 148 |
1 files changed, 148 insertions, 0 deletions
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; +} |