HomePhabricator

[libc++][format] Adds integer formatter.

Authored by Mordante on Dec 14 2020, 8:39 AM.

Description

[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

Details

Committed
MordanteOct 7 2021, 8:07 AM
Reviewer
Restricted Project
Differential Revision
D103433: [libc++][format] Adds integer formatter.
Parents
rGc50162b2711e: [gn build] Port d550930afcbb
Branches
Unknown
Tags
Unknown