3 ms·
> because when a nothrow fuction does happen to throw, you're in UB land IIRC that was the originally proposed behavior for noexcept, but it was changed at som
by aw1621107 7y ago
> because when a nothrow fuction does happen to throw, you're in UB land
IIRC that was the originally proposed behavior for noexcept, but it was changed at some point to call std::terminate instead.
- gmueckl 7y agoYikes, of course it should be noexcept instead of nothrow in my previous post! However, I don't find any referenc to noexcept having gotten defined behaviour. Do you have any pointers?
- aw1621107 7y agoIn the current version of the standard on the GitHub repo [0], Section 14.5 Paragraph 5 says: > Whenever an exception is thrown and the search for a handler (14.4) encounters the outermost block of a function with a non-throwing exception specification, the function std::terminate is called (14.6.1). I don't know when precisely noexcept was changed to call std::terminate, but I did find N3103 (included in the 2010-08 post-Rapperswil mailing [1]), which argued that the standard should require calling std::terminate to avoid security issues. [0]: https://github.com/cplusplus/draft https://github.com/cplusplus/draft [1]: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3103.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n310...