This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++: Non-allowed exception diagnostic?


   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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]