Update ChangeLogs and version numbers for 2.95.3 release
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.robertl / eb17.C
blobf32dadba9a53468a503e704da85974656438ea4d
1 // excess errors test - XFAIL
2 // covariant return types in are currently not support for complex inheritance
3 #include <stdio.h>
5 class A {
6 public:
7     virtual void print();
8     virtual A * clone();
9 };
11 class B : virtual public A {
12 public:
13     void print();
14     B * clone();
17 void A::print()
19     printf("A\n");
22 void B::print()
24     printf("B\n");
28 A * A::clone()
30     return this;
33 B * B::clone()
35     return this;
39 int main()
41     A * a = new B;
42     B * b = dynamic_cast<B *>(a);
44     printf("%p\n",b);                // (*2*)
45     b->print();
47     a = b;
48     printf("%p\n",a);
49     a->print();
51     a = a->clone();
52     printf("%p\n",a);
53     a->print();                      // (*1*)
55     return 0;