summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr59265.C
blob: be4c6e1e8d250ed0670be77ed9756878dc4f0138 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do compile { target c++11 } }
// { dg-options "-fprofile-use" }

class A {
  int m_fn1() const;
  unsigned m_fn2() const;
};
class B {
public:
  virtual void m_fn1();
};
class C final : B {
  C();
  virtual void m_fn2() { m_fn1(); }
};
int a;
unsigned A::m_fn2() const {
  if (m_fn1())
    return 0;
  a = m_fn2();
}
C::C() {}