aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/devirt-39.C
blob: 8cd734d77c036d719ed4c5adf5aeb09d890f6edb (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
// PR c++/61214
/* { dg-options "-O2"  } */

struct Base
{
  virtual ~Base();
  virtual Base* clone() {
    return 0;
  }
};

struct Foo : Base
{
  virtual ~Foo();
  virtual Base* clone() {
    return new Foo();
  }
};

int main()
{
  Base* f = new Foo();
  f->clone();
  return 0;
}

/* { dg-final { scan-assembler-not "_ZN3Foo5cloneEv" } } */