From Bugzilla Helper: User-Agent: Mozilla/4.76 [en] (X11; U; Linux 2.2.16-22smp i686) When a function specifies the exceptions that it may throw, the compiler can check if a caller is either handling the exceptions or throwing them too. g++ does not check that. Reproducible: Always Steps to Reproduce: #include <exception> void foo() throw (exception) { throw exception(); } int main() { foo(); // should get a warning here return 0; } Actual Results: The program above compiles without any warning and dumps core when run. Expected Results: The program should still compile, but g++ should give a warning that the exception is not being handled, so the programmer could create a try block and handle it more gracefully than simply dumping core.
Also: void foo() throw(int) { throw "Fred"; } should also generate a warning.
This is an enhancement request that should have been filed upstream. See http://gcc.gnu.org/bugzilla/