https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107778
--- Comment #8 from cqwrteur <unlvsur at live dot com> --- (In reply to cqwrteur from comment #6) > (In reply to Jonathan Wakely from comment #4) > > (In reply to cqwrteur from comment #3) > > > Also why the function is not noexcept? > > > > Writing to streams can throw. > > > > If you don't like the default handler you can provide your own. > > The problem is that the function is still not marked as noexcept and it will > cause serious issues with noexcept functions (like using contracts in > operator[] for example) btw I do not know whether there is a toggle to just add a contract check with __builtin_trap() or std::terminate for example. The current implementation of the contract ts in GCC is ridiculously expensive tbh due to too many parameters that need to be passed into the handler function.