Skip to content

Commit 12c97c5

Browse files
danratkoeppe
authored andcommitted
P2602R2 Poison Pills are Too Toxic
Fixes NB US 111 (C++23 CD).
1 parent ff2298e commit 12c97c5

File tree

4 files changed

+29
-68
lines changed

4 files changed

+29
-68
lines changed

source/iterators.tex

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,12 +1133,8 @@
11331133
\item \tcode{iter_move(E)}, if
11341134
\tcode{E} has class or enumeration type and
11351135
\tcode{iter_move(E)} is a well-formed expression when treated as an unevaluated operand,
1136-
with overload resolution performed in a context
1137-
that does not include a declaration of \tcode{ranges::iter_move}
1138-
but does include the declaration
1139-
\begin{codeblock}
1140-
void iter_move();
1141-
\end{codeblock}
1136+
where the meaning of \tcode{iter_move} is established as-if by performing
1137+
argument-dependent lookup only\iref{basic.lookup.argdep}.
11421138

11431139
\item Otherwise, if the expression \tcode{*E} is well-formed:
11441140
\begin{itemize}
@@ -1203,6 +1199,11 @@
12031199
If the function selected by overload resolution does not exchange the values
12041200
denoted by \tcode{E1} and \tcode{E2},
12051201
the program is ill-formed, no diagnostic required.
1202+
\begin{note}
1203+
This precludes calling unconstrained \tcode{std::iter_swap}. When the deleted
1204+
overload is viable, program-defined overloads need to be more
1205+
specialized\iref{temp.func.order} to be selected.
1206+
\end{note}
12061207

12071208
\item Otherwise, if the types of \tcode{E1} and \tcode{E2} each model
12081209
\libconcept{indirectly_readable}, and if the reference types of \tcode{E1} and \tcode{E2}

source/lib-intro.tex

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -845,21 +845,6 @@
845845
Each customization point object type constrains its return type to model a
846846
particular concept.
847847

848-
\pnum
849-
\begin{note}
850-
Many of the customization point objects in the library evaluate function call
851-
expressions with an unqualified name which results in a call to a
852-
program-defined function found by argument dependent name
853-
lookup\iref{basic.lookup.argdep}. To preclude such an expression resulting in a
854-
call to unconstrained functions with the same name in namespace \tcode{std},
855-
customization point objects specify that lookup for these expressions is
856-
performed in a context that includes deleted overloads matching the signatures
857-
of overloads defined in namespace \tcode{std}. When the deleted overloads are
858-
viable, program-defined overloads need to be more specialized\iref{temp.func.order}
859-
or more constrained\iref{temp.constr.order} to be used by a customization point
860-
object.
861-
\end{note}
862-
863848
\rSec3[functions.within.classes]{Functions within classes}
864849

865850
\pnum

source/ranges.tex

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -640,15 +640,10 @@
640640
\tcode{auto(begin(t))}
641641
is a valid expression whose type models
642642
\libconcept{input_or_output_iterator}
643-
with overload resolution performed in a context in which
644-
unqualified lookup for \tcode{begin} finds only the declarations
645-
\begin{codeblock}
646-
void begin(auto&) = delete;
647-
void begin(const auto&) = delete;
648-
\end{codeblock}
643+
where the meaning of \tcode{begin} is established as-if by performing
644+
argument-dependent lookup only\iref{basic.lookup.argdep},
649645
then \tcode{ranges::begin(E)} is expression-equivalent to
650-
\tcode{auto(begin(t))}
651-
with overload resolution performed in the above context.
646+
that expression.
652647

653648
\item
654649
Otherwise, \tcode{ranges::begin(E)} is ill-formed.
@@ -711,15 +706,10 @@
711706
\tcode{auto(end(t))}
712707
is a valid expression whose type models
713708
\tcode{\libconcept{sentinel_for}<iterator_t<T>>}
714-
with overload resolution performed in a context in which
715-
unqualified lookup for \tcode{end} finds only the declarations
716-
\begin{codeblock}
717-
void end(auto&) = delete;
718-
void end(const auto&) = delete;
719-
\end{codeblock}
709+
where the meaning of \tcode{end} is established as-if by performing
710+
argument-dependent lookup only\iref{basic.lookup.argdep},
720711
then \tcode{ranges::end(E)} is expression-equivalent to
721-
\tcode{auto(end(t))}
722-
with overload resolution performed in the above context.
712+
that expression.
723713

724714
\item
725715
Otherwise, \tcode{ranges::end(E)} is ill-formed.
@@ -833,15 +823,10 @@
833823
\tcode{auto(rbegin(t))}
834824
is a valid expression whose type models
835825
\libconcept{input_or_output_iterator}
836-
with overload resolution performed in a context in which
837-
unqualified lookup for \tcode{rbegin} finds only the declarations
838-
\begin{codeblock}
839-
void rbegin(auto&) = delete;
840-
void rbegin(const auto&) = delete;
841-
\end{codeblock}
826+
where the meaning of \tcode{rbegin} is established as-if by performing
827+
argument-dependent lookup only\iref{basic.lookup.argdep},
842828
then \tcode{ranges::rbegin(E)} is expression-equivalent to
843-
\tcode{auto(rbegin(t))}
844-
with overload resolution performed in the above context.
829+
that expression.
845830

846831
\item
847832
Otherwise, if both \tcode{ranges::begin(t)} and \tcode{ranges::end(t)}
@@ -902,15 +887,10 @@
902887
\tcode{auto(rend(t))}
903888
is a valid expression whose type models
904889
\tcode{\libconcept{sentinel_for}<decltype(ranges::rbegin(E))>}
905-
with overload resolution performed in a context in which
906-
unqualified lookup for \tcode{rend} finds only the declarations
907-
\begin{codeblock}
908-
void rend(auto&) = delete;
909-
void rend(const auto&) = delete;
910-
\end{codeblock}
890+
where the meaning of \tcode{rend} is established as-if by performing
891+
argument-dependent lookup only\iref{basic.lookup.argdep},
911892
then \tcode{ranges::rend(E)} is expression-equivalent to
912-
\tcode{auto(rend(t))}
913-
with overload resolution performed in the above context.
893+
that expression.
914894

915895
\item
916896
Otherwise, if both \tcode{ranges::begin(t)} and \tcode{ranges::end(t)}
@@ -1032,15 +1012,10 @@
10321012
\tcode{disable_sized_range<remove_cv_t<T>>} is \tcode{false} and
10331013
\tcode{auto(size(t))}
10341014
is a valid expression of integer-like type
1035-
with overload resolution performed in a context in which
1036-
unqualified lookup for \tcode{size} finds only the declarations
1037-
\begin{codeblock}
1038-
void size(auto&) = delete;
1039-
void size(const auto&) = delete;
1040-
\end{codeblock}
1015+
where the meaning of \tcode{size} is established as-if by performing
1016+
argument-dependent lookup only\iref{basic.lookup.argdep},
10411017
then \tcode{ranges::size(E)} is expression-equivalent to
1042-
\tcode{auto(size(t))}
1043-
with overload resolution performed in the above context.
1018+
that expression.
10441019

10451020
\item
10461021
Otherwise, if

source/support.tex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@
684684
#define @\defnlibxname{cpp_lib_polymorphic_allocator}@ 201902L // also in \libheader{memory_resource}
685685
#define @\defnlibxname{cpp_lib_print}@ 202207L // also in \libheader{print}, \libheader{ostream}
686686
#define @\defnlibxname{cpp_lib_quoted_string_io}@ 201304L // also in \libheader{iomanip}
687-
#define @\defnlibxname{cpp_lib_ranges}@ 202207L
687+
#define @\defnlibxname{cpp_lib_ranges}@ 202211L
688688
// also in \libheader{algorithm}, \libheader{functional}, \libheader{iterator}, \libheader{memory}, \libheader{ranges}
689689
#define @\defnlibxname{cpp_lib_ranges_as_const}@ 202207L // also in \libheader{ranges}
690690
#define @\defnlibxname{cpp_lib_ranges_as_rvalue}@ 202207L // also in \libheader{ranges}
@@ -4924,8 +4924,8 @@
49244924
\item
49254925
Otherwise, \tcode{strong_ordering(strong_order(E, F))}
49264926
if it is a well-formed expression
4927-
with overload resolution performed in a context
4928-
that does not include a declaration of \tcode{std::strong_order}.
4927+
where the meaning of \tcode{strong_order} is established as-if by performing
4928+
argument-dependent lookup only\iref{basic.lookup.argdep}.
49294929
\item
49304930
Otherwise, if the decayed type \tcode{T} of \tcode{E} is
49314931
a floating-point type,
@@ -4962,8 +4962,8 @@
49624962
\item
49634963
Otherwise, \tcode{weak_ordering(weak_order(E, F))}
49644964
if it is a well-formed expression
4965-
with overload resolution performed in a context
4966-
that does not include a declaration of \tcode{std::weak_order}.
4965+
where the meaning of \tcode{weak_order} is established as-if by performing
4966+
argument-dependent lookup only\iref{basic.lookup.argdep}.
49674967
\item
49684968
Otherwise, if the decayed type \tcode{T} of \tcode{E}
49694969
is a floating-point type,
@@ -5014,8 +5014,8 @@
50145014
\item
50155015
Otherwise, \tcode{partial_ordering(partial_order(E, F))}
50165016
if it is a well-formed expression
5017-
with overload resolution performed in a context
5018-
that does not include a declaration of \tcode{std::partial_order}.
5017+
where the meaning of \tcode{partial_order} is established as-if by performing
5018+
argument-dependent lookup only\iref{basic.lookup.argdep}.
50195019
\item
50205020
Otherwise, \tcode{partial_ordering(compare_three_way()(E, F))}
50215021
if it is a well-formed expression.

0 commit comments

Comments
 (0)