c++ exception spec bug
SmartList
list@utumno.student.utwente.nl
Sun Jan 7 14:21:00 GMT 2001
Using -fomit-frame-pointer in combinations with (restrictive) exceptions
specs doesn't work correctly in the latest gcc cvs tree.
This piece of code aborts incorrectly (it should catch):
class dummy {
int x;
public:
dummy(void) throw() : x(0) {}
~dummy(void) {}
};
void thrower(void) throw(int) {
dummy dobj;
throw 10;
}
int main(void) throw() {
try {
thrower();
} catch(int) {
}
}
Replacing 'void thrower(void) throw(int)' with 'void thrower(void)' fixes
this. Strangely, turning on the -fno-enforce-eh-specs also fixes the abort,
not sure whether the object gets destructed though, using
-fno-enforce-eh-specs doesn't work for the larger sources I've tried.
Thomas
--
More information about the Gcc
mailing list