Weird exception problem ...

Gerald Gutierrez gutier@intergate.bc.ca
Wed Mar 17 22:19:00 GMT 1999


Well I never thought this would dump core but it does on my computer. I'm
currently using pgcc-1.1.1 to try the program below. It's incredibly simple. It
puts an object on the stack which throws an exception, then tries to catch it in
the main function. But it doesn't seem to catch the exception and the program
just dumps core.

Can someone please confirm that this program really dumps with the real
egcs-1.1.1 ?

Thanks.


#include <stdio.h>

class Alpha {
public:
    Alpha (void) throw (int) { printf ("Throwing..\n"); throw 1234; }
    ~Alpha (void) throw () { }
};

int main (int ac, char* av[])
{
    try {
        Alpha conn;
    } catch (int v) {
        printf ("Caught\n");
    }
    return 0;
}


More information about the Gcc-bugs mailing list