Calling std::terminate()
from code compiled with disabled exceptions, I noted that behavior differs for gcc and msvc. In first case program was aborted as I expected, whereas in second case nothing happened (the program continued execution).
As it turns out, msvc has dummy implementation for terminate function when _HAS_EXCEPTIONS macro is not set:
inline void __CRTDECL terminate() _NOEXCEPT
{ // handle exception termination
}
Visual Studio 2017, Version 15.7.2
cppreference says:
std::terminate() may also be called directly from the program.
Doesn't this mean that abort/handler must be called anyway, not depending on exceptions ability?