3 // Copyright (C) 2002 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 27 Nov 2002 <nathan@codesourcery.com>
6 // covariant returns. Fixed & virtual offset.
14 virtual B1 *foo1 () {return this;}
15 virtual B2 *foo2 (D *);
20 virtual B2 *baz1 () {return this;}
21 virtual B1 *baz2 (D *);
24 struct Pad1 { virtual ~Pad1 (){}};
25 struct Pad2 { virtual ~Pad2 (){}};
26 struct Proxy1 : Pad1, B1 {};
27 struct Proxy2 : Pad2, B2 {};
29 struct D : virtual Proxy1, virtual Proxy2
31 virtual D *foo1 () {return this;}
32 virtual D *foo2 (D *d) {return d;}
33 virtual D *baz1 () {return this;}
34 virtual D *baz2 (D *d) {return d;}
37 B2 *B1::foo2 (D *d) {return d;}
38 B1 *B2::baz2 (D *d) {return d;}
40 int test (B1 *b1, B2 *b2, D *d)
42 if (b1->foo1 () != b1)
44 if (b2->baz1 () != b2)
46 if (b1->foo2 (d) != b2)
48 if (b2->baz2 (d) != b1)
71 if ((r = test (&d, &d, &d)))