1// { dg-do run  }
2// Bug: catching pointers by reference doesn't work right.
3
4extern "C" int printf (const char *, ...);
5
6struct E {
7  int x;
8  E(int i) { x = i; }
9};
10
11int main()
12{
13  try {
14    E *p = new E(5);
15    throw p;
16  }
17
18  catch (E *&e) {
19    printf ("address of e is 0x%lx\n", (__SIZE_TYPE__)e);
20    printf ("(__SIZE_TYPE__)e: %d ( != 5 ?)\n", (__SIZE_TYPE__)e);
21    printf ("            e->x: %d ( == 5 ?)\n", e->x);
22    return !((__SIZE_TYPE__)e != 5 && e->x == 5);
23  }
24  return 2;
25}
26