view gcc/testsuite/g++.dg/ipa/pr64896.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 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; int fn3 () const; C *fn4 () const; };

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

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

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