diff --git a/libcxx/include/ostream b/libcxx/include/ostream --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -222,9 +222,11 @@ basic_ostream& operator<<(basic_streambuf* __sb); +#if _LIBCPP_STD_VER > 14 _LIBCPP_INLINE_VISIBILITY basic_ostream& operator<<(nullptr_t) { return *this << "nullptr"; } +#endif // 27.7.2.7 Unformatted output: basic_ostream& put(char_type __c); diff --git a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp --- a/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp +++ b/libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp @@ -67,6 +67,7 @@ os << &sb2; assert(sb.str() == "testing..."); } +#if TEST_STD_VER > 14 { // LWG 2221 - nullptr testbuf sb; std::ostream os(&sb); @@ -74,6 +75,7 @@ assert(sb.str().size() != 0); LIBCPP_ASSERT(sb.str() == "nullptr"); } +#endif return 0; }