From 051d17d38bc782b13b588b0e3827e59a2050577f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 12:09:55 -0700 Subject: [PATCH 01/16] LWG2994 Needless UB for basic_string and basic_string_view --- source/strings.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/strings.tex b/source/strings.tex index 66fc8b2094..3bd859e555 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -2368,9 +2368,7 @@ function or operator has no other effect on the \tcode{basic_string} object. \pnum -In every specialization \tcode{basic_string}, -the type \tcode{allocator_traits::value_type} shall name the same type -as \tcode{charT}. Every object of type +Every object of type \tcode{basic_string} uses an object of type \tcode{Allocator} to allocate and free storage for the contained \tcode{charT} objects as needed. The \tcode{Allocator} object used is @@ -2383,6 +2381,8 @@ an allocator-aware container, but does not use the allocator's \tcode{construct} and \tcode{destroy} member functions\iref{container.requirements.pre}. +The program is ill-formed if +\tcode{Allocator::value_type} is not the same type as \tcode{charT}. \end{note} \begin{note} The program is ill-formed if \tcode{traits::char_type} From 03da5baa5317c28b7d4c1e5e43ebadb995e4c663 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 12:32:44 -0700 Subject: [PATCH 02/16] LWG3884 flat_foo is missing allocator-extended copy/move constructors --- source/containers.tex | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/source/containers.tex b/source/containers.tex index 39d1107df5..0a8a417d4d 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -14758,6 +14758,11 @@ // \ref{flat.map.cons}, construct/copy/destroy flat_map() : flat_map(key_compare()) { } + template + flat_map(const flat_map&, const Allocator& a); + template + flat_map(flat_map&&, const Allocator& a); + flat_map(key_container_type key_cont, mapped_container_type mapped_cont, const key_compare& comp = key_compare()); template @@ -15166,6 +15171,10 @@ \indexlibraryctor{flat_map}% \begin{itemdecl} +template + flat_map(const flat_map&, const Allocator& a); +template + flat_map(flat_map&&, const Allocator& a); template flat_map(const key_compare& comp, const Allocator& a); template @@ -15938,6 +15947,11 @@ // \ref{flat.multimap.cons}, construct/copy/destroy flat_multimap() : flat_multimap(key_compare()) { } + template + flat_multimap(const flat_multimap&, const Allocator& a); + template + flat_multimap(flat_multimap&&, const Allocator& a); + flat_multimap(key_container_type key_cont, mapped_container_type mapped_cont, const key_compare& comp = key_compare()); template @@ -16308,6 +16322,10 @@ \indexlibraryctor{flat_multimap}% \begin{itemdecl} +template + flat_multimap(const flat_multimap&, const Allocator& a); +template + flat_multimap(flat_multimap&&, const Allocator& a); template flat_multimap(const key_compare& comp, const Allocator& a); template @@ -16499,6 +16517,11 @@ // \ref{flat.set.cons}, constructors flat_set() : flat_set(key_compare()) { } + template + flat_set(const flat_set&, const Allocator& a); + template + flat_set(flat_set&&, const Allocator& a); + explicit flat_set(container_type cont, const key_compare& comp = key_compare()); template flat_set(const container_type& cont, const Allocator& a); @@ -16808,6 +16831,10 @@ \indexlibraryctor{flat_set}% \begin{itemdecl} +template + flat_set(const flat_set&, const Allocator& a); +template + flat_set(flat_set&&, const Allocator& a); template flat_set(const key_compare& comp, const Allocator& a); template @@ -17153,6 +17180,11 @@ // \ref{flat.multiset.cons}, constructors flat_multiset() : flat_multiset(key_compare()) { } + template + flat_multiset(const flat_multiset&, const Allocator& a); + template + flat_multiset(flat_multiset&&, const Allocator& a); + explicit flat_multiset(container_type cont, const key_compare& comp = key_compare()); template flat_multiset(const container_type& cont, const Allocator& a); @@ -17464,6 +17496,10 @@ \indexlibraryctor{flat_multiset}% \begin{itemdecl} +template + flat_multiset(const flat_multiset&, const Allocator& a); +template + flat_multiset(flat_multiset&&, const Allocator& a); template flat_multiset(const key_compare& comp, const Allocator& a); template From aa4dd7792470d33b8bb9254a8712416038910345 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 12:35:30 -0700 Subject: [PATCH 03/16] LWG3885 'op' should be in [zombie.names] --- source/lib-intro.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index f5039472b1..944afab25e 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -2968,6 +2968,7 @@ \item \indexlibraryzombie{argument_type} \tcode{argument_type}, \item \indexlibraryzombie{first_argument_type} \tcode{first_argument_type}, \item \indexlibraryzombie{io_state} \tcode{io_state}, +\item \indexlibraryzombie{op} \tcode{op}, \item \indexlibraryzombie{open_mode} \tcode{open_mode}, \item \indexlibraryzombie{preferred} \tcode{preferred}, \item \indexlibraryzombie{second_argument_type} \tcode{second_argument_type}, From e25a755305c2250c358149994c3837d856813de5 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 12:46:07 -0700 Subject: [PATCH 04/16] LWG3893 LWG 3661 broke atomic> a; a = nullptr; --- source/threads.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/threads.tex b/source/threads.tex index e4fa6273c9..527bf57e7a 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -4905,6 +4905,7 @@ operator shared_ptr() const noexcept; void store(shared_ptr desired, memory_order order = memory_order::seq_cst) noexcept; void operator=(shared_ptr desired) noexcept; + void operator=(nullptr_t) noexcept; shared_ptr exchange(shared_ptr desired, memory_order order = memory_order::seq_cst) noexcept; @@ -4991,6 +4992,17 @@ Equivalent to \tcode{store(desired)}. \end{itemdescr} +\indexlibrarymember{operator=}{atomic>}% +\begin{itemdecl} +void operator=(nullptr_t) noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to \tcode{store(nullptr)}. +\end{itemdescr} + \indexlibrarymember{load}{atomic>}% \begin{itemdecl} shared_ptr load(memory_order order = memory_order::seq_cst) const noexcept; From 8f03433864cc4a8f783ce6c9560500ff27d8748f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 12:49:27 -0700 Subject: [PATCH 05/16] LWG3894 generator::promise_type::yield_value(ranges::elements_of) should not be noexcept --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 851ed0248e..77da1e74ef 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -15957,7 +15957,7 @@ template requires @\libconcept{convertible_to}@, yielded> - auto yield_value(ranges::elements_of r) noexcept; + auto yield_value(ranges::elements_of r); void await_transform() = delete; @@ -16121,7 +16121,7 @@ \begin{itemdecl} template requires @\libconcept{convertible_to}@, yielded> - auto yield_value(ranges::elements_of r) noexcept; + auto yield_value(ranges::elements_of r); \end{itemdecl} \begin{itemdescr} From 0ce870684c5b88093ba8b106be551b4b8dbcf03e Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 12:51:25 -0700 Subject: [PATCH 06/16] LWG3903 span destructor is redundantly noexcept --- source/containers.tex | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 0a8a417d4d..3ec378df65 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -17844,8 +17844,6 @@ template constexpr explicit(@\seebelow@) span(const span& s) noexcept; - ~span() noexcept = default; - constexpr span& operator=(const span& other) noexcept = default; // \ref{span.sub}, subviews From fe5702cf22d6b57bb2004725bf7b624f3c196555 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 12:54:06 -0700 Subject: [PATCH 07/16] LWG3904 lazy_split_view::outer-iterator's const-converting constructor isn't setting trailing_empty_ --- source/ranges.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 77da1e74ef..71527b1726 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -7803,8 +7803,9 @@ \begin{itemdescr} \pnum \effects -Initializes \exposid{parent_} with \tcode{i.\exposid{parent_}} and -\exposid{current_} with \tcode{std::move(i.\exposid{current_})}. +Initializes \exposid{parent_} with \tcode{i.\exposid{parent_}}, +\exposid{current_} with \tcode{std::move(i.\exposid{current_})}, and +\exposid{trailing_empty_} with \tcode{i.\exposid{trailing_empty_}}. \end{itemdescr} \indexlibrarymember{operator*}{lazy_split_view::\exposid{outer-iterator}}% From b4e5007ba2f8e2ef04a34484114119ace4b2c1c5 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 12:55:41 -0700 Subject: [PATCH 08/16] LWG3905 Type of std::fexcept_t --- source/numerics.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/numerics.tex b/source/numerics.tex index 785bb29f51..3f9a3cde71 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -125,7 +125,7 @@ namespace std { // types using fenv_t = @\textit{object type}@; - using fexcept_t = @\textit{integer type}@; + using fexcept_t = @\textit{object type}@; // functions int feclearexcept(int except); From e45205ca8c5d135feb39597ef5079d1ec306c1df Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 13:39:14 -0700 Subject: [PATCH 09/16] LWG3912 enumerate_view::iterator::operator- should be noexcept --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 71527b1726..a0ec16dd42 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -9634,7 +9634,7 @@ requires @\libconcept{random_access_range}@<@\exposid{Base}@>; friend constexpr @\exposid{iterator}@ operator-(const @\exposid{iterator}@& x, difference_type y) requires @\libconcept{random_access_range}@<@\exposid{Base}@>; - friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y); + friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) noexcept; friend constexpr auto iter_move(const @\exposid{iterator}@& i) noexcept(noexcept(ranges::iter_move(i.@\exposid{current_}@)) && @@ -9901,7 +9901,7 @@ \indexlibrarymember{operator-}{enumerate_view::\exposid{iterator}}% \begin{itemdecl} -friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y); +friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) noexcept; \end{itemdecl} \begin{itemdescr} From 6ed8e7aa6459d18470b0b61b68831a2ff708ef7c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 13:41:14 -0700 Subject: [PATCH 10/16] LWG3914 Inconsistent template-head of ranges::enumerate_view --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index a0ec16dd42..25021fd30c 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -433,8 +433,8 @@ } // \ref{range.enumerate}, enumerate view - template<@\libconcept{input_range}@ View> - requires @\libconcept{view}@ + template<@\libconcept{view}@ V> + requires @\seebelow@ class enumerate_view; // freestanding template From 0c3b5309b153edb2b2bfcf32b1f93f23fa9e29ac Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 13:44:10 -0700 Subject: [PATCH 11/16] LWG3915 Redundant paragraph about expression variations --- source/ranges.tex | 8 -------- 1 file changed, 8 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 25021fd30c..c30a56a901 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1265,14 +1265,6 @@ \end{itemdecl} \begin{itemdescr} -\pnum -The required expressions -\tcode{ranges::begin(t)} -and -\tcode{ranges::end(t)} -of the \libconcept{range} concept -do not require implicit expression variations\iref{concepts.equality}. - \pnum Given an expression \tcode{t} such that \tcode{decltype((t))} is \tcode{T\&}, \tcode{T} models \libconcept{range} only if From 32acefaf129ef9614da9744add6baf46bec2fd5b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 13:49:09 -0700 Subject: [PATCH 12/16] LWG3925 Concept formattable's definition is incorrect --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index c99d900ebc..86bdd254b9 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15851,7 +15851,7 @@ template concept @\deflibconcept{formattable}@ = - @\exposconcept{formattable-with}@, basic_format_context<@\placeholder{fmt-iter-for}@>>; + @\exposconcept{formattable-with}@, basic_format_context<@\placeholder{fmt-iter-for}@, charT>>; \end{codeblock} \pnum From 90dc5f0898adf439d676a7931fd35ee1ed816146 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 13:59:20 -0700 Subject: [PATCH 13/16] LWG3927 Unclear preconditions for operator[] for sequence containers --- source/containers.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 3ec378df65..4d49855d66 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -2176,8 +2176,8 @@ \tcode{reference; const_reference} for constant \tcode{a} \pnum -\returns -\tcode{*(a.begin() + n)} +\effects +Equivalent to: \tcode{return *(a.begin() + n);} \pnum \remarks From c0579dde6ff9584bead5ae9ccdff86ae681e1b11 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 14:04:10 -0700 Subject: [PATCH 14/16] LWG3935 template constexpr complex& operator=(const complex&) has no specification --- source/numerics.tex | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/numerics.tex b/source/numerics.tex index 3f9a3cde71..81efc1e347 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -500,6 +500,23 @@ \tcode{*this}. \end{itemdescr} +\indexlibrarymember{operator=}{complex}% +\begin{itemdecl} +template constexpr complex& operator=(const complex& rhs); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Assigns the value \tcode{rhs.real()} to the real part and +the value \tcode{rhs.imag()} to the imaginary part +of the complex value \tcode{*this}. + +\pnum +\returns +\tcode{*this}. +\end{itemdescr} + \indexlibrarymember{operator+=}{complex}% \begin{itemdecl} template constexpr complex& operator+=(const complex& rhs); From 756d2cac8df25e08c3da86ca7b31bb1d2310367a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 14:12:27 -0700 Subject: [PATCH 15/16] LWG3938 Cannot use std::expected monadic ops with move-only error_type --- source/utilities.tex | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 86bdd254b9..8cb4e79509 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -8310,7 +8310,7 @@ \begin{itemdescr} \pnum -Let \tcode{U} be \tcode{remove_cvref_t>}. +Let \tcode{U} be \tcode{remove_cvref_t>}. \pnum \constraints @@ -8326,7 +8326,7 @@ Equivalent to: \begin{codeblock} if (has_value()) - return invoke(std::forward(f), value()); + return invoke(std::forward(f), **this); else return U(unexpect, error()); \end{codeblock} @@ -8341,7 +8341,7 @@ \begin{itemdescr} \pnum Let \tcode{U} be -\tcode{remove_cvref_t>}. +\tcode{remove_cvref_t>}. \pnum \constraints @@ -8357,7 +8357,7 @@ Equivalent to: \begin{codeblock} if (has_value()) - return invoke(std::forward(f), std::move(value())); + return invoke(std::forward(f), std::move(**this)); else return U(unexpect, std::move(error())); \end{codeblock} @@ -8375,7 +8375,7 @@ \pnum \constraints -\tcode{is_constructible_v} is \tcode{true}. +\tcode{is_constructible_v} is \tcode{true}. \pnum \mandates @@ -8387,7 +8387,7 @@ Equivalent to: \begin{codeblock} if (has_value()) - return G(in_place, value()); + return G(in_place, **this); else return invoke(std::forward(f), error()); \end{codeblock} @@ -8406,7 +8406,7 @@ \pnum \constraints -\tcode{is_constructible_v} is \tcode{true}. +\tcode{is_constructible_v} is \tcode{true}. \pnum \mandates @@ -8418,7 +8418,7 @@ Equivalent to: \begin{codeblock} if (has_value()) - return G(in_place, std::move(value())); + return G(in_place, std::move(**this)); else return invoke(std::forward(f), std::move(error())); \end{codeblock} @@ -8433,7 +8433,7 @@ \begin{itemdescr} \pnum Let \tcode{U} be -\tcode{remove_cv_t>}. +\tcode{remove_cv_t>}. \pnum \constraints @@ -8445,7 +8445,7 @@ If \tcode{is_void_v} is \tcode{false}, the declaration \begin{codeblock} -U u(invoke(std::forward(f), value())); +U u(invoke(std::forward(f), **this)); \end{codeblock} is well-formed. @@ -8459,9 +8459,9 @@ Otherwise, if \tcode{is_void_v} is \tcode{false}, returns an \tcode{expected} object whose \exposid{has_val} member is \tcode{true} and \exposid{val} member is direct-non-list-initialized with -\tcode{invoke(std::forward(f), value())}. +\tcode{invoke(std::forward(f), **this)}. \item -Otherwise, evaluates \tcode{invoke(std::forward(f), value())} and then +Otherwise, evaluates \tcode{invoke(std::forward(f), **this)} and then returns \tcode{expected()}. \end{itemize} \end{itemdescr} @@ -8475,7 +8475,7 @@ \begin{itemdescr} \pnum Let \tcode{U} be -\tcode{remove_cv_t>}. +\tcode{remove_cv_t>}. \pnum \constraints @@ -8486,9 +8486,9 @@ \tcode{U} is a valid value type for \tcode{expected}. If \tcode{is_void_v} is \tcode{false}, the declaration \begin{codeblock} -U u(invoke(std::forward(f), std::move(value()))); +U u(invoke(std::forward(f), std::move(**this))); \end{codeblock} -is well-formed for some invented variable \tcode{u}. +is well-formed. \pnum \effects @@ -8500,10 +8500,10 @@ Otherwise, if \tcode{is_void_v} is \tcode{false}, returns an \tcode{expected} object whose \exposid{has_val} member is \tcode{true} and \exposid{val} member is direct-non-list-initialized with -\tcode{invoke(std::forward(f), std::move(value()))}. +\tcode{invoke(std::forward(f), std::move(**this))}. \item -Otherwise, evaluates \tcode{invoke(std::forward(f), std::move(value()))} and -then returns \tcode{expected()}. +Otherwise, evaluates \tcode{invoke(std::forward(f), std::move(**this))} and +then returns \tcode{ex\-pected()}. \end{itemize} \end{itemdescr} @@ -8519,7 +8519,7 @@ \pnum \constraints -\tcode{is_constructible_v} is \tcode{true}. +\tcode{is_constructible_v} is \tcode{true}. \pnum \mandates @@ -8533,7 +8533,7 @@ \pnum \returns If \tcode{has_value()} is \tcode{true}, -\tcode{expected(in_place, value())}; otherwise, an \tcode{expected} +\tcode{expected(in_place, **this)}; otherwise, an \tcode{expected} object whose \exposid{has_val} member is \tcode{false} and \exposid{unex} member is direct-non-list-initialized with \tcode{invoke(std::forward(f), error())}. \end{itemdescr} @@ -8551,7 +8551,7 @@ \pnum \constraints -\tcode{is_constructible_v} is \tcode{true}. +\tcode{is_constructible_v} is \tcode{true}. \pnum \mandates @@ -8565,7 +8565,7 @@ \pnum \returns If \tcode{has_value()} is \tcode{true}, -\tcode{expected(in_place, std::move(value()))}; otherwise, an +\tcode{expected(in_place, std::move(**this))}; otherwise, an \tcode{expected} object whose \exposid{has_val} member is \tcode{false} and \exposid{unex} member is direct-non-list-initialized with \tcode{invoke(std::forward(f), std::move(error()))}. From 14eb0ae4c95202fc9c877cf3268473a35179fdd2 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 21 Jun 2023 14:15:54 -0700 Subject: [PATCH 16/16] LWG3940 std::expected::value() also needs E to be copy constructible --- source/utilities.tex | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/utilities.tex b/source/utilities.tex index 8cb4e79509..3a89948f7b 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -9188,6 +9188,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\mandates +\tcode{is_copy_constructible_v} is \tcode{true}. + \pnum \throws \tcode{bad_expected_access(error())} if \tcode{has_value()} is \tcode{false}. @@ -9199,6 +9203,11 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\mandates +\tcode{is_copy_constructible_v} is \tcode{true} and +\tcode{is_move_constructible_v} is \tcode{true}. + \pnum \throws \tcode{bad_expected_access(std::move(error()))}