[all-commits] [llvm/llvm-project] f0e610: [libc++][format] Adds formatter<charT[N], charT>.

mordante via All-commits all-commits at lists.llvm.org
Wed May 18 11:10:33 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: f0e61029506fd63bb300f2dbbd65ba792e4ef3a2
      https://github.com/llvm/llvm-project/commit/f0e61029506fd63bb300f2dbbd65ba792e4ef3a2
  Author: Mark de Wever <koraq at xs4all.nl>
  Date:   2022-05-18 (Wed, 18 May 2022)

  Changed paths:
    M libcxx/include/__format/formatter_string.h
    M libcxx/test/libcxx/utilities/format/format.formatter/format.formatter.spec/formattable.compile.pass.cpp
    A libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/formatter.char_array.pass.cpp
    M libcxx/test/std/utilities/format/format.formatter/format.formatter.spec/types.compile.pass.cpp

  Log Message:
  -----------
  [libc++][format] Adds formatter<charT[N], charT>.

This formatter isn't in the list of required formatters in

[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>;

Since remove_cvref_t<const charT[N]> is charT[N] the formatter is
required by

[format.functions]/25
  Preconditions: formatter<remove_cvref_t<Ti>, charT> meets the
  BasicFormatter requirements ([formatter.requirements]) for each Ti in
  Args.

Depends on D120921

Reviewed By: #libc, Mordante

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




More information about the All-commits mailing list