diff options
author | Ville Voutilainen <ville.voutilainen@gmail.com> | 2019-01-10 15:14:57 +0200 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2019-01-10 13:14:57 +0000 |
commit | c3799b164fac7576ada4cad5a5069cbe911b4849 (patch) | |
tree | f84fa45aa7f81f4cb7d7a541bd155b083ede00ec /libstdc++-v3/include | |
parent | e222497dcb808dc0c8e24dcded5b90bac4b59122 (diff) | |
download | gcc-c3799b164fac7576ada4cad5a5069cbe911b4849.tar.gz |
Implement LWG 2221: formatted output operator for nullptr
2019-01-10 Ville Voutilainen <ville.voutilainen@gmail.com>
Jonathan Wakely <jwakely@redhat.com>
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 <jwakely@redhat.com>
From-SVN: r267808
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/std/ostream | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libstdc++-v3/include/std/ostream b/libstdc++-v3/include/std/ostream index 50c99b25d58..2541d978886 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 |