.
[official-gcc.git] / gcc / testsuite / g++.dg / ipa / pr65002.C
blobb505ac82c54255d54ed326b5c4088cef6cad656f
1 /* PR tree-optimization/65002 */
2 /* { dg-do compile } */
3 /* { dg-options "-O2" } */
5 namespace fastmath {
6   template <typename T> float floor(const T &) __attribute__((const));
7   template <typename T> float floor(const T &p1) { return p1; }
9 using fastmath::floor;
10 class A {
11 public:
12   A(int, int);
13   virtual void m_fn1(float) const;
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;
22 int a;
23 void Convert() {
24   if (int *c = 0)
25     B(*c, a);