http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55917

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Yuri Aksenov from comment #7)
> > If it's guaranteed that an uncaught exception leaving that function will 
> > still 
> > call terminate, then the catch(...) block could be removed. Maybe I could 
> > do 
> > that conditionally for targets where it's known to work as required.
> 
> I vote for this enhancement to remove catch(...) block from
> execute_native_thread_routine function.

This isn't a democracy ;)

> According to standard (15.3) Handling an exception
> > If no matching handler is found, the function std::terminate() is called; 
> > whether or not the stack is unwound before this call to std::terminate() is 
> > implementation-deļ¬ned (15.5.1).
> 
> So if we remove catch(...), std::terminate should be called anyway (it's a
> bug otherwise).

The catch(...) is there to provide the [thread.thread.constr]/4 requirement
that std::terminate is called. If it isn't there, are you saying Pthreads or
the OS guarantees that an exception in the function passed to pthread_create()
will cause a call to std::terminate()? Where is that guaranteed?  Where is it
implemented?

You can't just say "rely on the implementation, it's a bug otherwise", this
code **is** the implementation.

Reply via email to