OSDN Git Service

PR c++/53549
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / torture / pr44813.C
1 typedef unsigned int PRUint32;
2 typedef int PRInt32;
3 typedef unsigned long PRUint64;
4 typedef int PRIntn;
5 typedef PRIntn PRBool;
6 struct nsRect {
7     nsRect(const nsRect& aRect) { }
8 };
9 enum nsCompatibility { eCompatibility_NavQuirks = 3 };
10 class gfxContext;
11 typedef PRUint64 nsFrameState;
12 class nsPresContext {
13 public:
14     nsCompatibility CompatibilityMode() const { }
15 };
16 class nsStyleContext {
17 public:
18     PRBool HasTextDecorations() const;
19 };
20 class nsIFrame {
21 public:
22     nsPresContext* PresContext() const;
23     nsStyleContext* GetStyleContext() const;
24     nsFrameState GetStateBits() const;
25     nsRect GetOverflowRect() const;
26 };
27 class nsFrame : public nsIFrame { };
28 class nsLineList_iterator { };
29 class nsLineList {
30 public:
31     typedef nsLineList_iterator iterator;
32 };
33 class gfxSkipCharsIterator { };
34 class gfxTextRun {
35 public:
36     class PropertyProvider { };
37 };
38 class nsTextFrame : public nsFrame
39 {
40   virtual nsRect ComputeTightBounds(gfxContext* aContext) const;
41   gfxSkipCharsIterator EnsureTextRun(gfxContext* aReferenceContext = 0L,
42                                      nsIFrame* aLineContainer = 0L,
43                                      const nsLineList::iterator* aLine = 0L,
44                                      PRUint32* aFlowEndInTextRun = 0L);
45 };
46 class PropertyProvider : public gfxTextRun::PropertyProvider
47 {
48 public:
49     PropertyProvider(nsTextFrame* aFrame, const gfxSkipCharsIterator& aStart);
50     PRInt32 mLength[64];
51 };
52 nsRect nsTextFrame::ComputeTightBounds(gfxContext* aContext) const
53 {
54   if ((GetStyleContext()->HasTextDecorations()
55        && eCompatibility_NavQuirks == PresContext()->CompatibilityMode())
56       || (GetStateBits() & (nsFrameState(1) << (23))))
57     return GetOverflowRect();
58   gfxSkipCharsIterator iter = const_cast<nsTextFrame*>(this)->EnsureTextRun();
59   PropertyProvider provider(const_cast<nsTextFrame*>(this), iter);
60 }