Skip to content

Commit a66f7d9

Browse files
committed
[expr.spaceship] Clarify treatment of pointers.
1 parent c4c52b5 commit a66f7d9

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

source/expressions.tex

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5938,8 +5938,8 @@
59385938
and applying \tcode{<=>} to the converted operands.
59395939

59405940
\pnum
5941-
If at least one of the operands is of pointer type and
5942-
the other operand is of pointer or array type,
5941+
If at least one of the operands is of object pointer type and
5942+
the other operand is of object pointer or array type,
59435943
array-to-pointer conversions\iref{conv.array},
59445944
pointer conversions\iref{conv.ptr},
59455945
and
@@ -5954,17 +5954,23 @@
59545954

59555955
\pnum
59565956
If the composite pointer type is an object pointer type,
5957-
\tcode{p <=> q} is of type \tcode{std::strong_ordering}.
5957+
\tcode{p <=> q} is of type \tcode{std::strong_ordering} and
5958+
the result is defined in terms of the following rules:
5959+
\begin{itemize}
5960+
\item
59585961
If two pointer operands \tcode{p} and \tcode{q} compare equal\iref{expr.eq},
59595962
\tcode{p <=> q} yields \tcode{std::strong_ordering::equal};
5960-
if \tcode{p} and \tcode{q} compare unequal,
5963+
\item
5964+
otherwise, if \tcode{p} and \tcode{q} compare unequal,
59615965
\tcode{p <=> q} yields
59625966
\tcode{std::strong_ordering::less}
59635967
if \tcode{q} compares greater than \tcode{p}
59645968
and
59655969
\tcode{std::strong_ordering::greater}
5966-
if \tcode{p} compares greater than \tcode{q}\iref{expr.rel}.
5967-
Otherwise, the result is unspecified.
5970+
if \tcode{p} compares greater than \tcode{q}\iref{expr.rel};
5971+
\item
5972+
otherwise, the result is unspecified.
5973+
\end{itemize}
59685974

59695975
\pnum
59705976
Otherwise, the program is ill-formed.

0 commit comments

Comments
 (0)