annotate gcc/testsuite/g++.dg/torture/pr42183.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 class IntSize {
kono
parents:
diff changeset
5 public:
kono
parents:
diff changeset
6 IntSize(int width, int height) : m_width(width), m_height(height) { }
kono
parents:
diff changeset
7 int m_width, m_height;
kono
parents:
diff changeset
8 };
kono
parents:
diff changeset
9 class IntPoint {
kono
parents:
diff changeset
10 public:
kono
parents:
diff changeset
11 IntPoint(int x, int y) : m_x(x), m_y(y) { }
kono
parents:
diff changeset
12 int m_x, m_y;
kono
parents:
diff changeset
13 };
kono
parents:
diff changeset
14 class IntRect {
kono
parents:
diff changeset
15 public:
kono
parents:
diff changeset
16 IntRect(int x, int y, int width, int height)
kono
parents:
diff changeset
17 : m_location(IntPoint(x, y)), m_size(IntSize(width, height)) { }
kono
parents:
diff changeset
18 void intersect(const IntRect&);
kono
parents:
diff changeset
19 IntPoint m_location;
kono
parents:
diff changeset
20 IntSize m_size;
kono
parents:
diff changeset
21 };
kono
parents:
diff changeset
22 inline IntRect intersection(const IntRect& a, const IntRect& b) {
kono
parents:
diff changeset
23 IntRect c = a;
kono
parents:
diff changeset
24 c.intersect(b);
kono
parents:
diff changeset
25 return c;
kono
parents:
diff changeset
26 }
kono
parents:
diff changeset
27 class RenderObject {
kono
parents:
diff changeset
28 public:
kono
parents:
diff changeset
29 int contentWidth() const { }
kono
parents:
diff changeset
30 int contentHeight() const { }
kono
parents:
diff changeset
31 virtual int xPos() const { }
kono
parents:
diff changeset
32 virtual int yPos() const { }
kono
parents:
diff changeset
33 virtual int paddingTop() const;
kono
parents:
diff changeset
34 virtual int paddingLeft() const;
kono
parents:
diff changeset
35 virtual int borderTop() const { }
kono
parents:
diff changeset
36 virtual int borderLeft() const { }
kono
parents:
diff changeset
37 };
kono
parents:
diff changeset
38 class RenderMenuList : public RenderObject {
kono
parents:
diff changeset
39 virtual IntRect controlClipRect(int tx, int ty) const;
kono
parents:
diff changeset
40 RenderObject* m_innerBlock;
kono
parents:
diff changeset
41 };
kono
parents:
diff changeset
42 IntRect RenderMenuList::controlClipRect(int tx, int ty) const {
kono
parents:
diff changeset
43 IntRect outerBox(tx + borderLeft() + paddingLeft(),
kono
parents:
diff changeset
44 ty + borderTop() + paddingTop(),
kono
parents:
diff changeset
45 contentWidth(), contentHeight());
kono
parents:
diff changeset
46 IntRect innerBox(tx + m_innerBlock->xPos() + m_innerBlock->paddingLeft(),
kono
parents:
diff changeset
47 ty + m_innerBlock->yPos() + m_innerBlock->paddingTop(),
kono
parents:
diff changeset
48 m_innerBlock->contentWidth(),
kono
parents:
diff changeset
49 m_innerBlock->contentHeight());
kono
parents:
diff changeset
50 return intersection(outerBox, innerBox);
kono
parents:
diff changeset
51 }
kono
parents:
diff changeset
52