aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/tree-ssa/pr46987.C
blob: 7163915a29856fd83f233663b562db4fc1eba45d (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 } */
/* { dg-options "-O" } */

struct A {
  virtual A *getThis();
};

struct B {
  virtual B *getThis();
};

struct AB : public A, public B {
  virtual AB *getThis() { return 0; }
};

void foo ()
{
  AB ab;
  B *b = &ab;
  b->getThis();
}