1 // { dg-do compile }
2 // { dg-additional-options "-Wno-return-type" }
3 
4 class IntSize {
5 public:
IntSize(int width,int height)6     IntSize(int width, int height) : m_width(width), m_height(height) { }
7     int m_width, m_height;
8 };
9 class IntPoint {
10 public:
IntPoint(int x,int y)11     IntPoint(int x, int y) : m_x(x), m_y(y) { }
12     int m_x, m_y;
13 };
14 class IntRect {
15 public:
IntRect(int x,int y,int width,int height)16     IntRect(int x, int y, int width, int height)
17         : m_location(IntPoint(x, y)), m_size(IntSize(width, height)) { }
18     void intersect(const IntRect&);
19     IntPoint m_location;
20     IntSize m_size;
21 };
intersection(const IntRect & a,const IntRect & b)22 inline IntRect intersection(const IntRect& a, const IntRect& b) {
23     IntRect c = a;
24     c.intersect(b);
25     return c;
26 }
27 class RenderObject  {
28 public:
contentWidth()29     int contentWidth() const { }
contentHeight()30     int contentHeight() const { }
xPos()31     virtual int xPos() const { }
yPos()32     virtual int yPos() const { }
33     virtual int paddingTop() const;
34     virtual int paddingLeft() const;
borderTop()35     virtual int borderTop() const { }
borderLeft()36     virtual int borderLeft() const { }
37 };
38 class RenderMenuList : public RenderObject {
39     virtual IntRect controlClipRect(int tx, int ty) const;
40     RenderObject* m_innerBlock;
41 };
controlClipRect(int tx,int ty)42 IntRect RenderMenuList::controlClipRect(int tx, int ty) const {
43     IntRect outerBox(tx + borderLeft() + paddingLeft(),
44                      ty + borderTop() + paddingTop(),
45                      contentWidth(), contentHeight());
46     IntRect innerBox(tx + m_innerBlock->xPos() + m_innerBlock->paddingLeft(),
47                      ty + m_innerBlock->yPos() + m_innerBlock->paddingTop(),
48                      m_innerBlock->contentWidth(),
49                      m_innerBlock->contentHeight());
50     return intersection(outerBox, innerBox);
51 }
52 
53