* config/bfin/bfin.c (effective_address_32bit_p): Return true for
[official-gcc/alias-decl.git] / gcc / testsuite / g++.dg / inherit / covariant1.C
blob978c3e8255a67733d66622269bbdf0e8b456f850
1 // PR c++/5607
3 // { dg-do run }
5 class A {
6 public:
7   virtual A* getThis() { return this; }
8 };
10 class B {
11 int a;
12 public:
13   virtual B* getThis() { return this; }
16 class AB : public A, public B {
17 public:
18   virtual AB* getThis() { return this; }
21 int main ()
23   AB* ab = new AB();
24   
25   A* a = ab;
26   B* b = ab;
28   if (a->getThis() != a
29       || b->getThis() != b)
30     return 1;
32   return 0;