[all-commits] [llvm/llvm-project] 82d218: [libc++][print] Includes <format>. (#76333)

Mark de Wever via All-commits all-commits at lists.llvm.org
Tue Jan 16 08:33:14 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 82d21814e6556480a71c83a2f8da350d0c8cadf6
      https://github.com/llvm/llvm-project/commit/82d21814e6556480a71c83a2f8da350d0c8cadf6
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2024-01-16 (Tue, 16 Jan 2024)

  Changed paths:
    M libcxx/include/ostream
    M libcxx/include/print
    A libcxx/test/libcxx/input.output/iostream.format/output.streams/ostream.syn/includes.compile.pass.cpp
    M libcxx/test/libcxx/transitive_includes/cxx03.csv
    M libcxx/test/libcxx/transitive_includes/cxx11.csv
    M libcxx/test/libcxx/transitive_includes/cxx14.csv
    M libcxx/test/libcxx/transitive_includes/cxx17.csv
    M libcxx/test/libcxx/transitive_includes/cxx20.csv
    M libcxx/test/libcxx/transitive_includes/cxx23.csv
    M libcxx/test/libcxx/transitive_includes/cxx26.csv
    A libcxx/test/std/input.output/iostream.format/print.fun/includes.compile.pass.cpp

  Log Message:
  -----------
  [libc++][print] Includes <format>. (#76333)

The overloads of `println` are specified in terms of `format`. The
function `format` is specified to work with ranges.

The implementations for `println` do not include `<format>`, but
libc++'s granularized header. This means the following example does not
work

  #include <vector>
  #include <print>

  int main() {
      std::vector<int> v{1, 2, 3};
      std::println("{}", v);
  }

(The other print functions also require this to work, they are specified
in terms of other format functions.)

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




More information about the All-commits mailing list