| 1 |
/* PR tree-optimization/65002 */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-O2" } */ |
| 4 |
|
| 5 |
namespace fastmath { |
| 6 |
template <typename T> float floor(const T &) __attribute__((const)); |
| 7 |
template <typename T> float floor(const T &p1) { return p1; } |
| 8 |
} |
| 9 |
using fastmath::floor; |
| 10 |
class A { |
| 11 |
public: |
| 12 |
A(int, int); |
| 13 |
virtual void m_fn1(float) const; |
| 14 |
}; |
| 15 |
class B : A { |
| 16 |
public: |
| 17 |
B(int, int p2) : A(entity, p2) {} |
| 18 |
void m_fn1(float p1) const { long b(floor(p1)); } |
| 19 |
int entity; |
| 20 |
}; |
| 21 |
|
| 22 |
int a; |
| 23 |
void Convert() { |
| 24 |
if (int *c = 0) |
| 25 |
B(*c, a); |
| 26 |
} |