[PATCH] (RFA tree-tailcall) PR c++/82081 - tail call optimization breaks noexcept

Ville Voutilainen ville.voutilainen@gmail.com
Fri Apr 12 21:43:00 GMT 2019

Jason wrote:

>If a noexcept function calls a function that might throw, doing the tail
call optimization means that an exception thrown in the called function
will propagate out, breaking the noexcept specification.  So we need to
prevent the optimization in that case.

>Tested x86_64-pc-linux-gnu.  OK for trunk or hold for GCC 10?  This isn't a
regression, but it is a straightforward fix for a wrong-code bug.

It is indeed not a regression, but exceptions escaping through a noexcept
are really unfortunate.

More information about the Gcc-patches mailing list