<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2703</TITLE>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<STYLE TYPE="text/css">
  INS { text-decoration:none; font-weight:bold; background-color:#A0FFA0 }
  .INS { text-decoration:none; background-color:#D0FFD0 }
  DEL { text-decoration:line-through; background-color:#FFA0A0 }
  .DEL { text-decoration:line-through; background-color: #FFD0D0 }
  @media (prefers-color-scheme: dark) {
    HTML { background-color:#202020; color:#f0f0f0; }
    A { color:#5bc0ff; }
    A:visited { color:#c6a8ff; }
    A:hover, a:focus { color:#afd7ff; }
    INS { background-color:#033a16; color:#aff5b4; }
    .INS { background-color: #033a16; }
    DEL { background-color:#67060c; color:#ffdcd7; }
    .DEL { background-color:#67060c; }
  }
  SPAN.cmnt { font-family:Times; font-style:italic }
</STYLE>
</HEAD>
<BODY>
<P><EM>This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21
  Core Issues List revision 118b.
  See http://www.open-std.org/jtc1/sc22/wg21/ for the official
  list.</EM></P>
<P>2025-09-28</P>
<HR>
<A NAME="2703"></A><H4>2703.
  
Three-way comparison requiring strong ordering for floating-point types, take 2
</H4>
<B>Section: </B>11.10.3&#160; [<A href="https://wg21.link/class.spaceship">class.spaceship</A>]
 &#160;&#160;&#160;

 <B>Status: </B>CD7
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2023-02-13<BR>


<P>[Accepted as a DR at the February, 2025 meeting.]</P>



<P>The resolution accepted for <A HREF="2539.html">issue 2539</A>
does not actually address the example in the issue, because overload
resolution is never performed for expressions involving only built-in
types.</P>

<P><B>Proposed resolution (2025-01-13, approved by CWG 2025-02-14):</B></P>

<P>Change in 11.10.3 [<A href="https://wg21.link/class.spaceship#1">class.spaceship</A>] paragraph 1 as follows:</P>

<BLOCKQUOTE>

The synthesized three-way comparison of type R
(17.12.2 [<A href="https://wg21.link/cmp.categories">cmp.categories</A>]) of glvalues a and b of the same type is
defined as follows:

<UL>

<LI>If a &lt;=&gt; b is usable (11.10.1 [<A href="https://wg21.link/class.compare.default">class.compare.default</A>]) and can
be explicitly converted to R using static_cast,
<TT>static_cast&lt;R&gt;(a &lt;=&gt; b)</TT>.</LI>

<LI>Otherwise, if <INS><TT>a &lt;=&gt; b</TT> is usable or</INS>
overload resolution for <TT>a &lt;=&gt; b</TT> is performed and finds
at least one viable candidate, the synthesized three-way comparison is
not defined.</LI>

<LI>Otherwise, ...</LI>

</UL>

</BLOCKQUOTE>

<BR><BR>
</BODY>
</HTML>
