Skip to content

Commit a85ec26

Browse files
jensmaurerzygoloid
authored andcommitted
[expr.spaceship] Clarify treatment of pointers.
1 parent 0c95d56 commit a85ec26

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

source/expressions.tex

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6040,8 +6040,8 @@
60406040
and applying \tcode{<=>} to the converted operands.
60416041

60426042
\pnum
6043-
If at least one of the operands is of pointer type and
6044-
the other operand is of pointer or array type,
6043+
If at least one of the operands is of object pointer type and
6044+
the other operand is of object pointer or array type,
60456045
array-to-pointer conversions\iref{conv.array},
60466046
pointer conversions\iref{conv.ptr},
60476047
and
@@ -6053,20 +6053,24 @@
60536053
If both of the operands are arrays,
60546054
array-to-pointer conversions\iref{conv.array} are not applied.
60556055
\end{note}
6056-
6057-
\pnum
6058-
If the composite pointer type is an object pointer type,
6059-
\tcode{p <=> q} is of type \tcode{std::strong_ordering}.
6056+
In this case,
6057+
\tcode{p <=> q} is of type \tcode{std::strong_ordering} and
6058+
the result is defined by the following rules:
6059+
\begin{itemize}
6060+
\item
60606061
If two pointer operands \tcode{p} and \tcode{q} compare equal\iref{expr.eq},
60616062
\tcode{p <=> q} yields \tcode{std::strong_ordering::equal};
6062-
if \tcode{p} and \tcode{q} compare unequal,
6063+
\item
6064+
otherwise, if \tcode{p} and \tcode{q} compare unequal,
60636065
\tcode{p <=> q} yields
60646066
\tcode{std::strong_ordering::less}
60656067
if \tcode{q} compares greater than \tcode{p}
60666068
and
60676069
\tcode{std::strong_ordering::greater}
6068-
if \tcode{p} compares greater than \tcode{q}\iref{expr.rel}.
6069-
Otherwise, the result is unspecified.
6070+
if \tcode{p} compares greater than \tcode{q}\iref{expr.rel};
6071+
\item
6072+
otherwise, the result is unspecified.
6073+
\end{itemize}
60706074

60716075
\pnum
60726076
Otherwise, the program is ill-formed.

0 commit comments

Comments
 (0)