[all-commits] [llvm/llvm-project] 3e9689: [libc++][format] Adds integer formatter.

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


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

  Changed paths:
    M libcxx/docs/Status/Cxx20Issues.csv
    M libcxx/docs/Status/Cxx20Papers.csv
    M libcxx/include/CMakeLists.txt
    M libcxx/include/__format/formatter.h
    A libcxx/include/__format/formatter_integer.h
    A libcxx/include/__format/formatter_integral.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_integer.module.verify.cpp
    A libcxx/test/libcxx/diagnostics/detail.headers/format/formatter_integral.module.verify.cpp
    A libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integer.pass.cpp
    R libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_integral.pass.cpp
    M libcxx/test/std/utilities/format/format.functions/format_tests.h
    A libcxx/test/std/utilities/format/format.functions/locale-specific_form.pass.cpp

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

Implements the formatter for all fundamental integer types
(except `char`, `wchar_t`, and `bool`).
[format.formatter.spec]/2.3
For each charT, for each cv-unqualified arithmetic type ArithmeticT other
than char, wchar_t, char8_t, char16_t, or char32_t, a specialization
```
  template<> struct formatter<ArithmeticT, charT>;
```
This removes the stub implemented in D96664.

As an extension it adds partial support for 128-bit integer types.

Implements parts of:
- P0645 Text Formatting
- P1652 Printf corner cases in std::format

Completes:
- LWG-3248 #b, #B, #o, #x, and #X presentation types misformat negative numbers

Reviewed By: #libc, ldionne, vitaut

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




More information about the All-commits mailing list