Exception Handling broken?
Felix von Leitner
leitner@math.fu-berlin.de
Sun Nov 9 16:25:00 GMT 1997
Hi!
I compiled this code:
#include <iostream.h>
class foo { };
main()
{
cerr << "if the program dumps core now, exception handling is flawed.\n";
try {
throw foo();
} catch (foo &x) {
cerr << "exception caught correctly!\n";
} catch (...) {
cerr << "exception not matched correctly!\n";
}
}
like this:
$ g++ -o et et.C
$ ./et
if the program dumps core now, exception handling is flawed.
zsh: 2861 segmentation fault (core dumped) ./et
$
Using -fno-rtti or -fsjlj-exceptions did not help at all.
Any suggestions? BTW:
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnulibc1/egcs-2.90.14p/specs
gcc version egcs-2.90.14p 971023 (gcc2-970802 experimental)
$
Felix
More information about the Gcc-bugs
mailing list