[all-commits] [llvm/llvm-project] 50cfb7: [libc++] Define ostream nullptr inserter for >= C+...

Joseph Loser via All-commits all-commits at lists.llvm.org
Tue Jul 19 17:18:22 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 50cfb76e029bbfda21622d4f00c9fe8a2a7099a6
      https://github.com/llvm/llvm-project/commit/50cfb76e029bbfda21622d4f00c9fe8a2a7099a6
  Author: Joe Loser <joeloser93 at gmail.com>
  Date:   2022-07-19 (Tue, 19 Jul 2022)

  Changed paths:
    M libcxx/include/ostream
    M libcxx/test/std/input.output/iostream.format/output.streams/ostream.formatted/ostream.inserters/streambuf.pass.cpp

  Log Message:
  -----------
  [libc++] Define ostream nullptr inserter for >= C++17 only

The `ostream` `nullptr` inserter implemented in 3c125fe is missing a C++ version
guard. Normally, `libc++` takes the stance of backporting LWG issues to older
standards modes as was done in 3c125fe. However, backporting to older standards
modes breaks existing code in popular libraries such as `Boost.Test` and
`Google Test` who define their own overload for `nullptr_t`.

Instead, only apply this `operator<<` overload in C++17 or later.

Fixes https://github.com/llvm/llvm-project/issues/55861.

Differential Revision: https://reviews.llvm.org/D127033




More information about the All-commits mailing list