Clean up some minor white space issues in trans-decl.c and trans-expr.c
[official-gcc.git] / gcc / testsuite / g++.dg / torture / pr40321.C
blob9177431098ec8e8ff7f36c0bd51aa6df944672bd
1 /* { dg-do compile } */
3 struct VectorD2
5   VectorD2() : x(0), y(0) { }
6   VectorD2(int _x, int _y) : x(_x), y(_y) { }
7   int x, y;
8   int GetLength2() const { return x*x + y*y; };
9   VectorD2 operator+(const VectorD2 vec) const {
10       return VectorD2(x+vec.x,y+vec.y);
11   }
13 struct Shape
15   enum Type { ST_RECT, ST_CIRCLE } type;
16   VectorD2 pos;
17   VectorD2 radius;
18   bool CollisionWith(const Shape& s) const;
20 bool Shape::CollisionWith(const Shape& s) const
22   if(type == ST_CIRCLE && s.type == ST_RECT)
23     return s.CollisionWith(*this);
24   return (pos + s.pos).GetLength2() < (radius + s.radius).GetLength2();