23 lines
336 B
C++
23 lines
336 B
C++
|
// Bug: catching pointers by reference doesn't work right.
|
||
|
|
||
|
extern "C" int printf (const char *, ...);
|
||
|
|
||
|
struct E {
|
||
|
int x;
|
||
|
E(int i) { x = i; };
|
||
|
};
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
try {
|
||
|
E *p = new E(5);
|
||
|
throw p;
|
||
|
}
|
||
|
|
||
|
catch (E *&e) {
|
||
|
printf ("address of e is 0x%x\n", (long)e);
|
||
|
return !(long(e) != 5 && e->x == 5);
|
||
|
}
|
||
|
return 2;
|
||
|
}
|