Dynamic Exception Specifications

Stephan Bergmann sbergman at redhat.com
Wed Jan 18 14:52:38 UTC 2017

On 01/18/2017 02:41 PM, Michael Stahl wrote:
> currently the exception specifications effectively serve as an assertion
> mechanism where an API implementation fails the assertion if it throws
> an exception that it isn't documented to throw.
> this happens from time to time, so i wonder what replacement you have in
> mind for the current 1000s of assertions to quickly and easily detect
> such bugs.

None.  :)  C++ no longer offers reasonable support for that (if it ever 
did adequately), so I guess we have to live with that, for better or worse.

The UNO bridges should silently translate invalid exceptions to 
RuntimeExceptions today.  We could make at least those violations more 
obvious, by e.g. turning into a failing assert those cases where an 
invalid UNO exception is attempted to be thrown across a bridge (in 
comparison to, say, some std::exception, for which silent translation to 
RuntimeException is probably fine already).

More information about the LibreOffice mailing list