summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/pr64896.C
blob: 7064cd05f9dfaff971355b33f5b5e5f771245ee5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// PR ipa/64896
// { dg-do compile }
// { dg-options "-O2" }

struct A { int a, b; };
struct B { A c; int d; };
struct C { virtual B fn1 () const; };
struct D { B fn2 () const; void fn3 () const; C *fn4 () const; };

void
D::fn3 () const
{
  fn4 ()->fn1 ();
}

B
D::fn2 () const
{
  return B ();
}

class F : C
{
  B
  fn1 () const
  {
    return B ();
  }
};