new
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.eh / ptr1.C
blob224952655ba99729c06a4eab4df107099257eb24
1 // Bug: catching pointers by reference doesn't work right.
3 extern "C" int printf (const char *, ...);
5 struct E {
6   int x;
7   E(int i) { x = i; };
8 };
10 int main()
12   try {
13     E *p = new E(5);
14     throw p;
15   }
17   catch (E *&e) {
18     printf ("address of e is 0x%x\n", (long)e);
19     return !(long(e) != 5 && e->x == 5);
20   }
21   return 2;