diff --git a/source/expressions.tex b/source/expressions.tex index a8202aaff7..c07dfdc961 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -5955,8 +5955,8 @@ and applying \tcode{<=>} to the converted operands. \pnum -If at least one of the operands is of pointer type and -the other operand is of pointer or array type, +If at least one of the operands is of object pointer type and +the other operand is of object pointer or array type, array-to-pointer conversions\iref{conv.array}, pointer conversions\iref{conv.ptr}, and @@ -5968,20 +5968,24 @@ If both of the operands are arrays, array-to-pointer conversions\iref{conv.array} are not applied. \end{note} - -\pnum -If the composite pointer type is an object pointer type, -\tcode{p <=> q} is of type \tcode{std::strong_ordering}. +In this case, +\tcode{p <=> q} is of type \tcode{std::strong_ordering} and +the result is defined by the following rules: +\begin{itemize} +\item If two pointer operands \tcode{p} and \tcode{q} compare equal\iref{expr.eq}, \tcode{p <=> q} yields \tcode{std::strong_ordering::equal}; -if \tcode{p} and \tcode{q} compare unequal, +\item +otherwise, if \tcode{p} and \tcode{q} compare unequal, \tcode{p <=> q} yields \tcode{std::strong_ordering::less} if \tcode{q} compares greater than \tcode{p} and \tcode{std::strong_ordering::greater} -if \tcode{p} compares greater than \tcode{q}\iref{expr.rel}. -Otherwise, the result is unspecified. +if \tcode{p} compares greater than \tcode{q}\iref{expr.rel}; +\item +otherwise, the result is unspecified. +\end{itemize} \pnum Otherwise, the program is ill-formed.