Clean up some minor white space issues in trans-decl.c and trans-expr.c
[official-gcc.git] / gcc / testsuite / g++.dg / torture / covariant-1.C
blob9f1fd0a52ca2b753babf9e490b6a1dc778124c18
1 // { dg-do run }
3 extern "C" void abort ();
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;
25   A* a = &ab;
26   B* b = &ab;
28   if (a->getThis() != a
29       || b->getThis() != b)
30     abort ();
32   return 0;