[all-commits] [llvm/llvm-project] d55093: [libc++][format] Adds string formatter.

mordante via All-commits all-commits at lists.llvm.org
Thu Oct 7 08:04:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d550930afcbb84740681c219ab13efd133143f88
      https://github.com/llvm/llvm-project/commit/d550930afcbb84740681c219ab13efd133143f88
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2021-10-07 (Thu, 07 Oct 2021)

  Changed paths:
    M libcxx/include/CMakeLists.txt
    M libcxx/include/__format/format_string.h
    M libcxx/include/__format/formatter.h
    A libcxx/include/__format/formatter_string.h
    M libcxx/include/__format/parser_std_format_spec.h
    M libcxx/include/format
    M libcxx/include/module.modulemap
    A libcxx/test/libcxx/diagnostics/detail.headers/format/formatter_string.module.verify.cpp
    M libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.c_string.pass.cpp
    M libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.const_char_array.pass.cpp
    M libcxx/test/std/utilities/format/format.formatter/format.context/format.formatter.spec/formatter.string.pass.cpp
    M libcxx/test/std/utilities/format/format.functions/format.pass.cpp
    M libcxx/test/std/utilities/format/format.functions/format_tests.h
    M libcxx/test/std/utilities/format/format.functions/formatted_size.pass.cpp
    M libcxx/test/std/utilities/format/format.functions/vformat.pass.cpp

  Log Message:
  -----------
  [libc++][format] Adds string formatter.

Implements the formatter for all string types.
[format.formatter.spec]/2.2
For each charT, the string type specializations
```
  template<> struct formatter<charT*, charT>;
  template<> struct formatter<const charT*, charT>;
  template<size_t N> struct formatter<const charT[N], charT>;
  template<class traits, class Allocator>
    struct formatter<basic_string<charT, traits, Allocator>, charT>;
  template<class traits>
    struct formatter<basic_string_view<charT, traits>, charT>;
```
This removes the stub implemented in D96664.

Implements parts of:
- P0645 Text Formatting
- P1868 width: clarifying units of width and precision in std::format

Reviewed By: #libc, ldionne, vitaut

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




More information about the All-commits mailing list