Skip to content

Commit 7b7db83

Browse files
authored
Merge 2023-02 LWG Motion 3
P2790R0 C++ Standard Library Immediate Issues to be moved in Issaquah, Feb. 2023; excluding issue 3441
2 parents be2a5d2 + 89c1f6c commit 7b7db83

13 files changed

+603
-321
lines changed

source/algorithms.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10781,7 +10781,7 @@
1078110781
\begin{codeblock}
1078210782
template<class T>
1078310783
constexpr void* @\placeholdernc{voidify}@(T& obj) noexcept {
10784-
return const_cast<void*>(static_cast<const volatile void*>(addressof(obj)));
10784+
return addressof(obj);
1078510785
}
1078610786
\end{codeblock}
1078710787

source/compatibility.tex

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,19 @@
249249
// implementation-defined number of \tcode{'*'} characters
250250
\end{codeblock}
251251

252+
\diffref{format.formatter.spec}
253+
\change
254+
Removed the \tcode{formatter} specialization:
255+
\begin{codeblock}
256+
template<size_t N> struct formatter<const charT[N], charT>;
257+
\end{codeblock}
258+
\rationale
259+
The specialization is inconsistent with the design of \tcode{formatter},
260+
which is intended to be instantiated only with cv-unqualified object types.
261+
\effect
262+
Valid \CppXX{} code that instantiated the removed specialization
263+
can become ill-formed.
264+
252265
\rSec2[diff.cpp20.strings]{\ref{strings}: strings library}
253266

254267
\diffref{string.classes}

source/containers.tex

Lines changed: 324 additions & 91 deletions
Large diffs are not rendered by default.

source/diagnostics.tex

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,6 @@
538538
\indexlibraryglobal{ENETUNREACH}%
539539
\indexlibraryglobal{ENFILE}%
540540
\indexlibraryglobal{ENOBUFS}%
541-
\indexlibraryglobal{ENODATA}%
542541
\indexlibraryglobal{ENODEV}%
543542
\indexlibraryglobal{ENOENT}%
544543
\indexlibraryglobal{ENOEXEC}%
@@ -548,8 +547,6 @@
548547
\indexlibraryglobal{ENOMSG}%
549548
\indexlibraryglobal{ENOPROTOOPT}%
550549
\indexlibraryglobal{ENOSPC}%
551-
\indexlibraryglobal{ENOSR}%
552-
\indexlibraryglobal{ENOSTR}%
553550
\indexlibraryglobal{ENOSYS}%
554551
\indexlibraryglobal{ENOTCONN}%
555552
\indexlibraryglobal{ENOTDIR}%
@@ -571,7 +568,6 @@
571568
\indexlibraryglobal{EROFS}%
572569
\indexlibraryglobal{ESPIPE}%
573570
\indexlibraryglobal{ESRCH}%
574-
\indexlibraryglobal{ETIME}%
575571
\indexlibraryglobal{ETIMEDOUT}%
576572
\indexlibraryglobal{ETXTBSY}%
577573
\indexlibraryglobal{EWOULDBLOCK}%
@@ -619,7 +615,6 @@
619615
#define ENETUNREACH @\seebelow@
620616
#define ENFILE @\seebelow@
621617
#define ENOBUFS @\seebelow@
622-
#define ENODATA @\seebelow@
623618
#define ENODEV @\seebelow@
624619
#define ENOENT @\seebelow@
625620
#define ENOEXEC @\seebelow@
@@ -629,8 +624,6 @@
629624
#define ENOMSG @\seebelow@
630625
#define ENOPROTOOPT @\seebelow@
631626
#define ENOSPC @\seebelow@
632-
#define ENOSR @\seebelow@
633-
#define ENOSTR @\seebelow@
634627
#define ENOSYS @\seebelow@
635628
#define ENOTCONN @\seebelow@
636629
#define ENOTDIR @\seebelow@
@@ -652,7 +645,6 @@
652645
#define EROFS @\seebelow@
653646
#define ESPIPE @\seebelow@
654647
#define ESRCH @\seebelow@
655-
#define ETIME @\seebelow@
656648
#define ETIMEDOUT @\seebelow@
657649
#define ETXTBSY @\seebelow@
658650
#define EWOULDBLOCK @\seebelow@
@@ -750,18 +742,15 @@
750742
no_child_process, // \tcode{ECHILD}
751743
no_link, // \tcode{ENOLINK}
752744
no_lock_available, // \tcode{ENOLCK}
753-
no_message_available, // \tcode{ENODATA}
754745
no_message, // \tcode{ENOMSG}
755746
no_protocol_option, // \tcode{ENOPROTOOPT}
756747
no_space_on_device, // \tcode{ENOSPC}
757-
no_stream_resources, // \tcode{ENOSR}
758748
no_such_device_or_address, // \tcode{ENXIO}
759749
no_such_device, // \tcode{ENODEV}
760750
no_such_file_or_directory, // \tcode{ENOENT}
761751
no_such_process, // \tcode{ESRCH}
762752
not_a_directory, // \tcode{ENOTDIR}
763753
not_a_socket, // \tcode{ENOTSOCK}
764-
not_a_stream, // \tcode{ENOSTR}
765754
not_connected, // \tcode{ENOTCONN}
766755
not_enough_memory, // \tcode{ENOMEM}
767756
not_supported, // \tcode{ENOTSUP}
@@ -779,7 +768,6 @@
779768
resource_unavailable_try_again, // \tcode{EAGAIN}
780769
result_out_of_range, // \tcode{ERANGE}
781770
state_not_recoverable, // \tcode{ENOTRECOVERABLE}
782-
stream_timeout, // \tcode{ETIME}
783771
text_file_busy, // \tcode{ETXTBSY}
784772
timed_out, // \tcode{ETIMEDOUT}
785773
too_many_files_open_in_system, // \tcode{ENFILE}

source/future.tex

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,25 @@
218218
unless the function's \throws element
219219
specifies throwing an exception when the precondition is violated.
220220

221+
\rSec1[depr.c.macros]{Deprecated C macros}
222+
223+
\pnum
224+
The header \libheader{stdalign.h} has the following macro:
225+
\indexheader{stdalign.h}%
226+
\indexlibraryglobal{__alignas_is_defined}%
227+
\begin{codeblock}
228+
#define @\xname{alignas_is_defined}@ 1
229+
\end{codeblock}
230+
231+
\pnum
232+
The header \libheader{stdbool.h} has the following macro:
233+
\indexheader{stdbool.h}%
234+
\indexhdr{stdbool.h}%
235+
\indexlibraryglobal{__bool_true_false_are_defined}%
236+
\begin{codeblock}
237+
#define @\xname{bool_true_false_are_defined}@ 1
238+
\end{codeblock}
239+
221240
\rSec1[depr.relops]{Relational operators}%
222241
\indexlibraryglobal{rel_ops}%
223242

@@ -1322,6 +1341,42 @@
13221341
\tcode{rdbuf()->pcount()}.
13231342
\end{itemdescr}
13241343

1344+
\rSec1[depr.cerrno]{Deprecated error numbers}
1345+
1346+
\pnum
1347+
The following macros are defined in addition to those
1348+
specified in \ref{cerrno.syn}:
1349+
1350+
\indexlibraryglobal{ENODATA}%
1351+
\indexlibraryglobal{ENOSR}%
1352+
\indexlibraryglobal{ENOSTR}%
1353+
\indexlibraryglobal{ETIME}%
1354+
\begin{codeblock}
1355+
#define ENODATA @\seebelow@
1356+
#define ENOSR @\seebelow@
1357+
#define ENOSTR @\seebelow@
1358+
#define ETIME @\seebelow@
1359+
\end{codeblock}
1360+
1361+
\pnum
1362+
The meaning of these macros is defined by the POSIX standard.
1363+
1364+
\pnum
1365+
The following \tcode{enum errc} enumerators are defined
1366+
in addition to those specified in \ref{system.error.syn}:
1367+
1368+
\begin{codeblock}
1369+
no_message_available, // \tcode{ENODATA}
1370+
no_stream_resources, // \tcode{ENOSR}
1371+
not_a_stream, // \tcode{ENOSTR}
1372+
stream_timeout, // \tcode{ETIME}
1373+
\end{codeblock}
1374+
1375+
\pnum
1376+
The value of each \tcode{enum errc} enumerator above
1377+
is the same as the value of the \libheader{cerrno} macro
1378+
shown in the above synopsis.
1379+
13251380
\rSec1[depr.default.allocator]{The default allocator}
13261381

13271382
\pnum

source/iostreams.tex

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,17 @@
506506
The results of including \libheader{iostream} in a translation unit shall be as if
507507
\libheader{iostream} defined an instance of \tcode{ios_base::Init} with static
508508
storage duration.
509+
Each \Cpp{} library module\iref{std.modules} in a hosted implementation
510+
shall behave as if it contains an interface unit that
511+
defines an unexported \tcode{ios_base::Init} variable with
512+
ordered initialization\iref{basic.start.dynamic}.
513+
514+
\begin{note}
515+
As a result, the definition of that variable is appearance-ordered before
516+
any declaration following the point of importation of a \Cpp{} library module.
517+
Whether such a definition exists is unobservable by a program that
518+
does not reference any of the standard iostream objects.
519+
\end{note}
509520

510521
\pnum
511522
Mixing operations on corresponding wide- and narrow-character streams
@@ -18592,6 +18603,10 @@
1859218603
The header \libheader{cinttypes} includes the header \libheaderref{cstdint} instead
1859318604
of \libheader{stdint.h}, and
1859418605
\item
18606+
\tcode{intmax_t} and \tcode{uintmax_t} are not required
18607+
to be able to represent all values of extended integer types
18608+
wider than \tcode{long long} and \tcode{unsigned long long}, respectively, and
18609+
\item
1859518610
if and only if the type \tcode{intmax_t} designates an extended integer
1859618611
type\iref{basic.fundamental}, the following function signatures are added:
1859718612
\begin{codeblock}

source/iterators.tex

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,14 +350,17 @@
350350
class basic_const_iterator; // freestanding
351351

352352
template<class T, @\libconcept{common_with}@<T> U>
353+
requires @\libconcept{input_iterator}@<common_type_t<T, U>>
353354
struct common_type<basic_const_iterator<T>, U> { // freestanding
354355
using type = basic_const_iterator<common_type_t<T, U>>;
355356
};
356357
template<class T, @\libconcept{common_with}@<T> U>
358+
requires @\libconcept{input_iterator}@<common_type_t<T, U>>
357359
struct common_type<U, basic_const_iterator<T>> { // freestanding
358360
using type = basic_const_iterator<common_type_t<T, U>>;
359361
};
360362
template<class T, @\libconcept{common_with}@<T> U>
363+
requires @\libconcept{input_iterator}@<common_type_t<T, U>>
361364
struct common_type<basic_const_iterator<T>, basic_const_iterator<U>> { // freestanding
362365
using type = basic_const_iterator<common_type_t<T, U>>;
363366
};
@@ -4213,10 +4216,16 @@
42134216
template<class I>
42144217
concept @\exposconcept{not-a-const-iterator}@ = @\seebelow@; // \expos
42154218

4219+
template<@\libconcept{indirectly_readable}@ I>
4220+
using @\exposidnc{iter-const-rvalue-reference-t}@ = // \expos
4221+
common_reference_t<const iter_value_t<I>&&, iter_rvalue_reference_t<I>>;
4222+
42164223
template<@\libconcept{input_iterator}@ Iterator>
42174224
class @\libglobal{basic_const_iterator}@ {
42184225
Iterator @\exposidnc{current_}@ = Iterator(); // \expos
42194226
using @\exposidnc{reference}@ = iter_const_reference_t<Iterator>; // \expos
4227+
using @\exposidnc{rvalue-reference}@ = // \expos
4228+
@\exposid{iter-const-rvalue-reference-t}@<Iterator>;
42204229

42214230
public:
42224231
using iterator_concept = @\seebelow@;
@@ -4312,6 +4321,11 @@
43124321
template<@\exposconcept{not-a-const-iterator}@ S>
43134322
requires @\libconcept{sized_sentinel_for}@<S, Iterator>
43144323
friend constexpr difference_type operator-(const S& x, const basic_const_iterator& y);
4324+
friend constexpr @\exposid{rvalue-reference}@ iter_move(const basic_const_iterator& i)
4325+
noexcept(noexcept(static_cast<@\exposid{rvalue-reference}@>(ranges::iter_move(i.@\exposid{current_}@))))
4326+
{
4327+
return static_cast<@\exposid{rvalue-reference}@>(ranges::iter_move(i.@\exposid{current_}@));
4328+
}
43154329
};
43164330
}
43174331
\end{codeblock}

source/lib-intro.tex

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,15 +1471,6 @@
14711471
the freestanding items\iref{freestanding.item} declared in the header.
14721472
\indextext{implementation!freestanding|)}%
14731473

1474-
\pnum
1475-
\begin{note}
1476-
Throwing a standard library provided exception
1477-
is not observably different from \tcode{terminate()}
1478-
if the implementation does not
1479-
unwind the stack during exception handling\iref{except.handle} and
1480-
the user's program contains no catch blocks.
1481-
\end{note}
1482-
14831474
\rSec2[using]{Using the library}
14841475

14851476
\rSec3[using.overview]{Overview}

source/memory.tex

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4993,6 +4993,24 @@
49934993
Initializes \tcode{s} with \tcode{smart},
49944994
\tcode{a} with \tcode{std::forward<Args>(args)...}, and
49954995
value-initializes \tcode{p}.
4996+
Then, equivalent to:
4997+
\begin{itemize}
4998+
\item
4999+
\begin{codeblock}
5000+
s.reset();
5001+
\end{codeblock}
5002+
if the expression \tcode{s.reset()} is well-formed;
5003+
5004+
\item
5005+
otherwise,
5006+
\begin{codeblock}
5007+
s = Smart();
5008+
\end{codeblock}
5009+
if \tcode{is_constructible_v<Smart>} is \tcode{true};
5010+
5011+
\item
5012+
otherwise, the program is ill-formed.
5013+
\end{itemize}
49965014

49975015
\pnum
49985016
\begin{note}

0 commit comments

Comments
 (0)