summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/virtual2.C
blob: ffdd71c13afd85ce72485aac1c4fdf4468e23389 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// { dg-do run  }
struct A {
  virtual A* f () { return this; }
};

struct B: public A {
  virtual B* f () { return 0; }
};

int main ()
{
  A* ap = new B;
  return (ap->f () != 0);
}