view gcc/testsuite/g++.dg/ipa/pr65002.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children 84e7813d76e9
line wrap: on
line source

/* PR tree-optimization/65002 */
/* { dg-do compile } */
/* { dg-options "-O2" } */

namespace fastmath {
  template <typename T> float floor(const T &) __attribute__((const));
  template <typename T> float floor(const T &p1) { return p1; }
}
using fastmath::floor;
class A {
public:
  A(int, int);
  virtual int m_fn1(float) const;
};
class B : A {
public:
  B(int, int p2) : A(entity, p2) {}
  int m_fn1(float p1) const { long b(floor(p1)); }
  int entity;
};

int a;
void Convert() {
  if (int *c = 0)
    B(*c, a);
}