https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103382

--- Comment #3 from Ivan Sorokin <vanyacpp at gmail dot com> ---
> Huh, I thought it was noexcept. Then yes, we should remove it.

Thank you very much! I'm looking forward for a fix.

> There are still lots of other places where the stadnard does require 
> 'noexcept' and cancellation will terminate.

Do you have any specific functions in mind? If so perhaps something can be done
about them too.

Some people claim that noexcept and cancellation and mutually incompatible, but
I don't think this is the case. I believe that by following a simple discipline
noexcept and cancellation can interact very well.

First of all not all noexcept functions are problematic: noexcept functions
that don't call cancellation points are perfectly fine.

The noexcept functions that do call some cancellation points can be fixed by
suppression/restoring of cancellation. For example, a destructor that calls
close() which is a cancellation point should just suppress/restore
cancellation. Same for a destructor that calls pthread_join(). One might say
that because of this we lose some cancellation points and this is true, but I
believe that noexcept are the places where program can not recover preserving
exception guarantees and having cancellation suppressed in these places is
perfectly fine.

Reply via email to