Skip to content

Commit 1e495d3

Browse files
burblebeetkoeppe
authored andcommitted
P2909R4 Fix formatting of code units as integers (Dude, where’s my char?)
1 parent 13c5095 commit 1e495d3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

source/support.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@
634634
#define @\defnlibxname{cpp_lib_flat_set}@ 202207L // also in \libheader{flat_set}
635635
#define @\defnlibxname{cpp_lib_format}@ 202311L // also in \libheader{format}
636636
#define @\defnlibxname{cpp_lib_format_ranges}@ 202207L // also in \libheader{format}
637+
#define @\defnlibxname{cpp_lib_format_uchar}@ 202311L // also in \libheader{format}
637638
#define @\defnlibxname{cpp_lib_formatters}@ 202302L // also in \libheader{stacktrace}, \libheader{thread}
638639
#define @\defnlibxname{cpp_lib_forward_like}@ 202207L // freestanding, also in \libheader{utility}
639640
#define @\defnlibxname{cpp_lib_freestanding_algorithm}@ 202311L

source/utilities.tex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16331,15 +16331,16 @@
1633116331
\pnum
1633216332
The available \tcode{charT} presentation types are specified in \tref{format.type.char}.
1633316333
%
16334-
\begin{floattable}{Meaning of \fmtgrammarterm{type} options for \tcode{charT}}{format.type.char}{ll}
16334+
\begin{floattable}{Meaning of \fmtgrammarterm{type} options for \tcode{charT}}{format.type.char}{lp{.8\hsize}}
1633516335
\topline
1633616336
\lhdr{Type} & \rhdr{Meaning} \\ \rowsep
1633716337
none, \tcode{c} &
1633816338
Copies the character to the output.
1633916339
\\ \rowsep
1634016340
%
1634116341
\tcode{b}, \tcode{B}, \tcode{d}, \tcode{o}, \tcode{x}, \tcode{X} &
16342-
As specified in \tref{format.type.int}.
16342+
As specified in \tref{format.type.int}
16343+
with \tcode{value} converted to the unsigned version of the underlying type.
1634316344
\\ \rowsep
1634416345
%
1634516346
\tcode{?} &
@@ -18262,7 +18263,7 @@
1826218263
\item
1826318264
otherwise, if \tcode{TD} is \tcode{char} and \tcode{char_type} is
1826418265
\keyword{wchar_t}, initializes \tcode{value} with
18265-
\tcode{static_cast<wchar_t>(v)};
18266+
\tcode{static_cast<wchar_t>(static_cast<unsigned char>(v))};
1826618267
\item
1826718268
otherwise, if \tcode{TD} is a signed integer type\iref{basic.fundamental}
1826818269
and \tcode{sizeof(TD) <= sizeof(int)},

0 commit comments

Comments
 (0)