Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/torture/pr78224.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// { dg-do compile } extern "C"{ float sqrtf(float); } inline float squareroot(const float f) { return sqrtf(f); } inline int squareroot(const int f) { return static_cast<int>(sqrtf(static_cast<float>(f))); } template <class T> class vector2d { public: vector2d(T nx, T ny) : X(nx), Y(ny) {} T getLength() const { return squareroot( X*X + Y*Y ); } T X; T Y; }; vector2d<int> getMousePos(); class Client { public: Client(); ~Client(); }; void the_game(float turn_amount) { Client client; bool first = true; while (1) { if (first) { first = false; } else { int dx = getMousePos().X; int dy = getMousePos().Y; turn_amount = vector2d<float>(dx, dy).getLength(); } } }