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++.dg/torture/pr33627.C | |
download | cbb-gcc-4.6.4-upstream.tar.bz2 cbb-gcc-4.6.4-upstream.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++.dg/torture/pr33627.C')
-rw-r--r-- | gcc/testsuite/g++.dg/torture/pr33627.C | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/torture/pr33627.C b/gcc/testsuite/g++.dg/torture/pr33627.C new file mode 100644 index 000000000..a14e34551 --- /dev/null +++ b/gcc/testsuite/g++.dg/torture/pr33627.C @@ -0,0 +1,57 @@ +/* { dg-do compile } */ + +typedef unsigned int UT_uint32; +typedef UT_uint32 PT_DocPosition; +typedef UT_uint32 PT_BlockOffset; +typedef enum _PTStruxType { PTX_Block } PTStruxType; +typedef UT_uint32 PL_ListenerId; +typedef const void * PL_StruxFmtHandle; +class PX_ChangeRecord; +class pf_Frag { + public: + typedef enum _PFType { PFT_Object } PFType; + inline PFType getType(void) const { } + inline pf_Frag * getNext(void) const { } + PT_DocPosition getPos(void) const { } +}; +class pf_Fragments { + public: + pf_Frag * getFirst() const; +}; +class pt_PieceTable { + bool getStruxOfTypeFromPosition(PL_ListenerId listenerId, PT_DocPosition docPos, PTStruxType pts, PL_StruxFmtHandle * psfh) const; + bool _tellAndMaybeAddListener(PL_ListenerId listenerId, bool bAdd); + pf_Fragments m_fragments; +}; +class pf_Frag_Object : public pf_Frag +{ + public: + virtual bool createSpecialChangeRecord(PX_ChangeRecord ** ppcr, PT_DocPosition dpos, PT_BlockOffset blockOffset) const; +}; +bool pt_PieceTable::_tellAndMaybeAddListener(PL_ListenerId listenerId, bool bAdd) +{ + PL_StruxFmtHandle sfh = 0; + PT_DocPosition sum = 0; + UT_uint32 blockOffset = 0; + for (pf_Frag * pf = m_fragments.getFirst(); (pf); pf=pf->getNext()) + { + pf_Frag_Object * pfo = static_cast<pf_Frag_Object *> (pf); + PX_ChangeRecord * pcr = __null; + bool bStatus1 = false; + if(sfh != __null) { + bStatus1 = pfo->createSpecialChangeRecord(&pcr,sum,blockOffset); + if (!(bStatus1)) + return (false); + } + else + { + PT_DocPosition pos = pf->getPos(); + getStruxOfTypeFromPosition(listenerId,pos,PTX_Block,&sfh); + bStatus1 = pfo->createSpecialChangeRecord(&pcr,pos,blockOffset); + if (!(bStatus1)) + return (false); + } + if (!(bStatus1)) + return (false); + } +} |