1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } } 2 // { dg-options "-fexceptions -w" } 3 4 // Ensure reference handling works. 5 6 #include <typeinfo> 7 8 struct B { fB9 virtual int f() { } 10 } ob; 11 12 struct D : public B { fD13 virtual int f() { } 14 } od; 15 main()16int main() { 17 B *b=&ob; 18 try { 19 void *vp = &dynamic_cast<D&>(*b); 20 return 1; 21 } catch (std::bad_cast) { 22 return 0; 23 } 24 return 1; 25 } 26