EH in egcs
Alexandre Oliva
oliva@dcc.unicamp.br
Sun Oct 26 19:34:00 GMT 1997
H J Lu writes:
> How come there are multiple uncaught exceptions active at the
> same time?
The following code fragment introduces two active uncaught exceptions.
The `throw 1' expression causes the bar object to be destructed.
While its destructor is being run, another exception is thrown. If
this exception were not caught, terminate would have been called.
Anyway, there can be more than one pending exception, as long as they
do not propagate outside the destructor called by the stack-unwinding
mechanism.
struct foo {
~foo() {
try { throw 2; }
catch(int) {}
}
};
main() {
try { foo bar; throw 1; }
catch(int) {}
}
> I assume we are not talking about multithreading.
That's another issue.
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil
More information about the Gcc
mailing list