[cfe-dev] clang, noexcept and terminate

John McCall rjmccall at apple.com
Mon Jan 30 13:56:18 PST 2012


On Jan 30, 2012, at 1:11 PM, Howard Hinnant wrote:
> That last problem is also the problem with having the compiler just call this new function which would handle all of these nasty details:
> 
>  void __cxa_call_terminate(void* arg);  // do the right thing and get better error messages!
> 
> So:
> 
> Can we transition to a compiler that calls __cxa_call_terminate on noexcept?  And how would that transition be managed?

These are really interesting points.  I have two responses.

The first is that this would be a change in the generic code-generation patterns of the compiler, and it needs to be proposed on the Itanium ABI list (cxx-abi-dev).

The second is that it poses significant backward-compatibility problems, because no existing runtime actually provides this function.  That's not completely damning, but for example, on Darwin it means we'd probably have to have a compiler-rt-like library that provides a default implementation (maybe one just calling std::terminate()) when system doesn't provide anything better.  That's a lot of complexity for this, although it doesn't mean we shouldn't do it.

John.



More information about the cfe-dev mailing list