I noticed that if new fails to find free-store memory to allocate, it will throw the standard library exception bad_alloc.
And in my understanding, if we don't catch an exception, std::abort will be called to terminate the program.
So I tried the following code (without #include anything):
int main()
{
int* p = new int[99999999999999]; // or any number that is sufficiently large
}
and the result stated that abort() has been called.
I know that new is implicitly declared in each translation unit even if the header is not included.
However, in my understanding, if we don't #include any standard header, facilities like standard library exception and std::abort are not defined.
So, my question is, how are bad_alloc thrown and std::abort called in the about situation where they are not defined?