[libcxx-commits] [PATCH] D125606: [libc++][format] Improve string formatters

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun May 15 06:07:12 PDT 2022


Mordante added reviewers: ldionne, vitaut.
Mordante marked an inline comment as done.
Mordante added inline comments.


================
Comment at: libcxx/include/__format/formatter_output.h:32
+
+// TODO FMT remove _v2 suffix.
+struct _LIBCPP_TYPE_VIS __padding_size_result_v2 {
----------------
This will be done after all formatters are converted to this style.


================
Comment at: libcxx/include/__format/parser_std_format_spec.h:1538
+  __sign __sign_ : 2 {__sign::__default};
+  uint8_t __alternate_form_ : 1 {false};
+  uint8_t __zero_padding_ : 1 {false};
----------------
Mordante wrote:
> philnik wrote:
> > Why not use `bool`?
> That will most likely change the size of the object on Windows. (Note that the underlying type of the enum classes is an uint8_t too.) I can test this after the Windows build is green.
I tested in Godbolt and it seems `bool` works. Maybe because it has the same size and alignment as the `uint8_t`. Since the CI is also happy I'll keep the `bool`s.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125606/new/

https://reviews.llvm.org/D125606



More information about the libcxx-commits mailing list