From c3799b164fac7576ada4cad5a5069cbe911b4849 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Thu, 10 Jan 2019 15:14:57 +0200 Subject: Implement LWG 2221: formatted output operator for nullptr 2019-01-10 Ville Voutilainen Jonathan Wakely Implement LWG 2221 * config/abi/pre/gnu.ver (GLIBCXX_3.4): Tighten patterns. (GLIBCXX_3.4.26): Add new exports. * include/Makefile.am: Add ostream-inst.cc. Move string-inst.cc to correct list of sources. * include/Makefile.in: Regenerate. * include/std/ostream (operator<<(nullptr_t)): New member function. * src/c++17/ostream-inst.cc: New file. * testsuite/27_io/basic_ostream/inserters_other/char/lwg2221.cc: New test. Co-Authored-By: Jonathan Wakely From-SVN: r267808 --- libstdc++-v3/include/std/ostream | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'libstdc++-v3/include/std') diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream index 50c99b2..2541d97 100644 --- a/libstdc++-v3/include/std/ostream +++ b/libstdc++-v3/include/std/ostream @@ -245,6 +245,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION operator<<(const void* __p) { return _M_insert(__p); } +#if __cplusplus >= 201703L + __ostream_type& + operator<<(nullptr_t) + { return *this << "nullptr"; } +#endif + /** * @brief Extracting from another streambuf. * @param __sb A pointer to a streambuf -- cgit v1.1