The std::basic_ostream::operator<< only has an overload for const char* or const void* which does not match in this case since you can not discard the volatile qualifier without a cast, this is covered in the draft C++ standard section 4.4 Qualification conversions which says:
A prvalue of type “pointer to cv1 T” can be converted to a prvalue of
type “pointer to cv2 T” if “cv2 T” is more cv-qualified than “cv1 T”.
so it is using the bool version and since it is not a nullptr the result is true.
If you remove the volatile qualifier from test this will provide the result you expect. Several answers suggest using a const_cast to remove the volatile qualifiers but this is undefined behavior. We can see by going to section 7.1.6.1 The cv-qualifiers paragraph 6 which says:
If an attempt is made to refer to an object defined with a
volatile-qualified type through the use of a glvalue with a
non-volatile-qualified type, the program behavior is undefined.
const_cast in this case yields a prvalue but dereferencing that pointer yields an lvalue which will invoke undefined behavior.