FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.mike / dyncast3.C
blob604382c89de7a6f751791eec7b999c42afbd7c7d
1 // Special g++ Options: -fexceptions -w
2 // excess errors test - XFAIL sparc64-*-elf arm-*-pe**-*
3 // Ensure that the return type of dynamic_cast is the real type.
5 struct B {
6   virtual int f() { }
7 };
9 struct D : public B {
10   virtual int f() { }
11   int i;
12 } od;
14 main() {
15   B *b=&od;
16   if (dynamic_cast<D*>(b)->i)
17     return 1;
18   return 0;