1 // { dg-do run { xfail sparc64-*-elf arm-*-pe } }
2 // { dg-options "-fexceptions" }
3 
4 #include <typeinfo>
5 
6 class B {
7 public:
8   int data;
B(int i)9   B(int i) : data(i) {
10   }
11 } b(42);
12 
main()13 main() {
14   try {
15     throw &b;
16   } catch (const B* bptr) {
17     if (bptr->data == 42)
18       {
19 	try {
20 	  throw &b;
21 	} catch (void *bptr) {
22 	  if (((B*)bptr)->data == 42)
23 	    return 0;
24 	}
25       }
26   }
27   return 1;
28 }
29