[cd]tor handler does not rethrow
Alexandre Oliva
oliva@dcc.unicamp.br
Sun Mar 1 16:52:00 GMT 1998
The following program:
#include <iostream.h>
struct X {
X()
try { throw 1; }
catch (...) { cout << "caught" << endl; }
};
int main()
try { X x; cout << "ok" << endl; }
catch (...) { cout << "caught again" << endl; }
compiled with several different versions of g++/egcs will print:
caught
ok
... instead of:
caught
caught again
... as required by paragraph 16 of the Nov '97 DWP (in
function-try-blocks of constructors and destructors, falling off a
handler causes the handled exception to be rethrown)
--
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-bugs
mailing list