3 // test of rtti of single inheritance and multiple inheritance with
10 int printf(const char *, ...);
20 class Y : public virtual X {
24 class Z : public virtual Y {
46 class D : public virtual A, private B {
50 class E : public virtual D, public B {
54 class F : public E, public virtual D {
87 vp = dynamic_cast<Y *> (&z);
88 if (vp == 0) error(11);
90 vp = dynamic_cast<Z *> (yp);
91 if (vp == 0) error(11);
93 vp = dynamic_cast<X *> (yp);
94 if (vp == 0) error(12);
96 vp = dynamic_cast<D *> (dp);
97 if (vp != (void *)dp) error(21);
99 // Ill-formed: dynamic_cast to private or ambiguous base
100 // vp = dynamic_cast<B *> (dp);
101 // if (vp == (void *)dp) error(21);
103 // vp = dynamic_cast<B *> (fp);
104 // if (vp == (void *)bbp) error(22);
106 vp = dynamic_cast<void *> (aap);
107 if (vp != (void *)fp) error(23);
109 vp = dynamic_cast<B *> (aap);
110 if (vp == (void *)bbp) error(24);