C++: Non-allowed exception diagnostic?
Frank Pilhofer
fp@fpx.de
Sat Mar 20 04:06:00 GMT 2004
Hi,
According to ISO C++, compilers are required to accept code that
might cause unexpected exceptions. The example given in in the
standard is
extern void f() throw (X, Y);
void g () throw (X)
{
f ();
}
which is well-formed, despite the fact that f() might throw an
exception of type Y, which is not acceptable according to g's
exception specification.
However, I think it would be helpful if the compiler produced
at least a diagnostic (warning) in this case.
I checked gcc's manual, and didn't see a compiler option that would
enable such diagnostics. Any hope of adding such a feature in future
versions?
Frank
--
Frank Pilhofer ........................................... fp@fpx.de
When money talks, nobody criticises its accent! - Alfred E. Neuman
More information about the Gcc
mailing list