This is the mail archive of the gcc-patches@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]

Re: [RFC] C++ vs forced unwinding


Hi,

On Tue, 1 Apr 2003, Richard Henderson wrote:

> On Tue, Apr 01, 2003 at 06:43:13PM -0500, Jason Merrill wrote:
> > Hmm.  It might be reasonable to make the same judgement about a throw(int)
> > function, but I'm inclined to keep throw() as a special case.
>
> Anyone else have an opinion here?

/me not being a C++ expert, but here is mine anyway: ;)

throw() states that a function doesn't throw an exception.  And it should
only say that.  I can't find a reason why it also should say, that such a
function can't call cancellation points, especially because it's a rather
difficult to get right requirement.  The reason is, that such cancellation
points are not part of C++, which means, that it suddenly is impossible to
write standard conforming programs, like:

int f() throw()
{
  try { g(); } catch (...) {}
}

If g() calls cancellation points this perfectly fine program suddenly
doesn't work per your definition of throw().


Ciao,
Michael.


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