gcc/testsuite/g++.dg/torture/pr59265.C
raw| 1 | // { dg-do compile } |
| 2 | // { dg-options "-fprofile-use -std=gnu++11 -Wno-return-type -Wno-missing-profile" } |
| 3 | |
| 4 | class A { |
| 5 | int m_fn1() const; |
| 6 | unsigned m_fn2() const; |
| 7 | }; |
| 8 | class B { |
| 9 | public: |
| 10 | virtual void m_fn1(); |
| 11 | }; |
| 12 | class C final : B { |
| 13 | C(); |
| 14 | virtual void m_fn2() { m_fn1(); } |
| 15 | }; |
| 16 | int a; |
| 17 | unsigned A::m_fn2() const { |
| 18 | if (m_fn1()) |
| 19 | return 0; |
| 20 | a = m_fn2(); |
| 21 | } |
| 22 | C::C() {} |