the original issue reproduced with operator<<(const char*) in libstdc++,
but this actually crashes with libc++. test the std::basic_streambuf*
overload instead, which is called out explicitly in
http://en.cppreference.com/w/cpp/io/ios_base/iostate:
> The badbit is set by the following standard library functions:
> * basic_ostream::operator<<(basic_streambuf*) when a null pointer is passed as the argument.