This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
C++: Non-allowed exception diagnostic?
- From: Frank Pilhofer <fp at fpx dot de>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 19 Mar 2004 19:55:45 -0500
- Subject: C++: Non-allowed exception diagnostic?
- Reply-to: Frank Pilhofer <fp at fpx dot de>
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