summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/eh28.C
blob: 47cd3861ca16a79e7ed839a03494cb42bf39ea80 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { dg-do run { xfail sparc64-*-elf arm-*-pe } }
// { dg-options "-fexceptions" }

#include <typeinfo>

int fail = 1;

class X            { public: virtual void p() { } };
class Y : public X { public: virtual void p() { fail = 0; } };

int
main()
{
  try          { Y y; throw y; }
  catch (X& x) { x.p();  }
  catch (...)  { }
  return fail;
}