annotate gcc/testsuite/g++.dg/torture/pr33627.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* { dg-do compile } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
2 /* { dg-additional-options "-Wno-return-type" } */
111
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 typedef unsigned int UT_uint32;
kono
parents:
diff changeset
5 typedef UT_uint32 PT_DocPosition;
kono
parents:
diff changeset
6 typedef UT_uint32 PT_BlockOffset;
kono
parents:
diff changeset
7 typedef enum _PTStruxType { PTX_Block } PTStruxType;
kono
parents:
diff changeset
8 typedef UT_uint32 PL_ListenerId;
kono
parents:
diff changeset
9 typedef const void * PL_StruxFmtHandle;
kono
parents:
diff changeset
10 class PX_ChangeRecord;
kono
parents:
diff changeset
11 class pf_Frag {
kono
parents:
diff changeset
12 public:
kono
parents:
diff changeset
13 typedef enum _PFType { PFT_Object } PFType;
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
14 inline PFType getType(void) const { return PFType(); }
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
15 inline pf_Frag * getNext(void) const { return 0; }
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
16 PT_DocPosition getPos(void) const { return PT_DocPosition(); }
111
kono
parents:
diff changeset
17 };
kono
parents:
diff changeset
18 class pf_Fragments {
kono
parents:
diff changeset
19 public:
kono
parents:
diff changeset
20 pf_Frag * getFirst() const;
kono
parents:
diff changeset
21 };
kono
parents:
diff changeset
22 class pt_PieceTable {
kono
parents:
diff changeset
23 bool getStruxOfTypeFromPosition(PL_ListenerId listenerId, PT_DocPosition docPos, PTStruxType pts, PL_StruxFmtHandle * psfh) const;
kono
parents:
diff changeset
24 bool _tellAndMaybeAddListener(PL_ListenerId listenerId, bool bAdd);
kono
parents:
diff changeset
25 pf_Fragments m_fragments;
kono
parents:
diff changeset
26 };
kono
parents:
diff changeset
27 class pf_Frag_Object : public pf_Frag
kono
parents:
diff changeset
28 {
kono
parents:
diff changeset
29 public:
kono
parents:
diff changeset
30 virtual bool createSpecialChangeRecord(PX_ChangeRecord ** ppcr, PT_DocPosition dpos, PT_BlockOffset blockOffset) const;
kono
parents:
diff changeset
31 };
kono
parents:
diff changeset
32 bool pt_PieceTable::_tellAndMaybeAddListener(PL_ListenerId listenerId, bool bAdd)
kono
parents:
diff changeset
33 {
kono
parents:
diff changeset
34 PL_StruxFmtHandle sfh = 0;
kono
parents:
diff changeset
35 PT_DocPosition sum = 0;
kono
parents:
diff changeset
36 UT_uint32 blockOffset = 0;
kono
parents:
diff changeset
37 for (pf_Frag * pf = m_fragments.getFirst(); (pf); pf=pf->getNext())
kono
parents:
diff changeset
38 {
kono
parents:
diff changeset
39 pf_Frag_Object * pfo = static_cast<pf_Frag_Object *> (pf);
kono
parents:
diff changeset
40 PX_ChangeRecord * pcr = __null;
kono
parents:
diff changeset
41 bool bStatus1 = false;
kono
parents:
diff changeset
42 if(sfh != __null) {
kono
parents:
diff changeset
43 bStatus1 = pfo->createSpecialChangeRecord(&pcr,sum,blockOffset);
kono
parents:
diff changeset
44 if (!(bStatus1))
kono
parents:
diff changeset
45 return (false);
kono
parents:
diff changeset
46 }
kono
parents:
diff changeset
47 else
kono
parents:
diff changeset
48 {
kono
parents:
diff changeset
49 PT_DocPosition pos = pf->getPos();
kono
parents:
diff changeset
50 getStruxOfTypeFromPosition(listenerId,pos,PTX_Block,&sfh);
kono
parents:
diff changeset
51 bStatus1 = pfo->createSpecialChangeRecord(&pcr,pos,blockOffset);
kono
parents:
diff changeset
52 if (!(bStatus1))
kono
parents:
diff changeset
53 return (false);
kono
parents:
diff changeset
54 }
kono
parents:
diff changeset
55 if (!(bStatus1))
kono
parents:
diff changeset
56 return (false);
kono
parents:
diff changeset
57 }
kono
parents:
diff changeset
58 }