The author presented this code under the title
A bus error on my platform
std::cout << "Oops!\n";
std::cout share a buffer, that buffer will probably be freed twice (once when
log goes out of scope, then once more when the program terminates).
This results in undefined behavior, so it's hard to tell the exact reason why it triggers a bus error on his machine but silently fails on yours.