<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1011</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="1011"></A><H4>1011.
  
Standard conversions that cannot be inverted
</H4>
<B>Section: </B>7.6.1.9&#160; [<A href="https://wg21.link/expr.static.cast">expr.static.cast</A>]
 &#160;&#160;&#160;

 <B>Status: </B>C++11
 &#160;&#160;&#160;

 <B>Submitter: </B>John Spicer
 &#160;&#160;&#160;

 <B>Date: </B>2009-12-03<BR>


<P>[Voted into the WP at the November, 2010 meeting.]</P>

<P>According to 7.6.1.9 [<A href="https://wg21.link/expr.static.cast#7">expr.static.cast</A>] paragraph 7, <TT>static_cast</TT>
can be used to perform the inverse of any standard conversion sequence
except the lvalue-to-rvalue, array-to-pointer, function-to-pointer, and
boolean conversions.  The null pointer and null pointer-to-member
conversions should also be listed &#8212; it should not be permitted to
cast a pointer or pointer-to-member to either integral type or
<TT>std::nullptr_t</TT>.</P>

<P><B>Proposed resolution (October, 2010):</B></P>

<OL>
<LI><P>Change 7.3.12 [<A href="https://wg21.link/conv.ptr#1">conv.ptr</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

...A null pointer constant can be converted to a pointer type; the
result is the <I>null pointer value</I> of that type and is
distinguishable from every other value of pointer to object or pointer
to function type. <INS>Such a conversion is called a <I>null pointer
conversion</I>.</INS> Two null pointer values...

</BLOCKQUOTE>

<LI><P>Change 7.3.13 [<A href="https://wg21.link/conv.mem#1">conv.mem</A>] paragraph 1 as follows:</P></LI>

<BLOCKQUOTE>

A null pointer constant (7.3.12 [<A href="https://wg21.link/conv.ptr">conv.ptr</A>]) can be converted
to a pointer to member type; the result is the <I>null member pointer
value</I> of that type and is distinguishable from any pointer to
member not created from a null pointer constant. <INS>Such a
conversion is called a <I>null member pointer conversion.</I></INS>
Two null member pointer values...

</BLOCKQUOTE>

<LI><P>Change 7.6.1.9 [<A href="https://wg21.link/expr.static.cast#7">expr.static.cast</A>] paragraph 7 as follows:</P></LI>

<BLOCKQUOTE>

The inverse of any standard conversion sequence (7.3 [<A href="https://wg21.link/conv">conv</A>])<DEL>, other than the</DEL> <INS>not containing an</INS>
lvalue-to-rvalue (7.3.2 [<A href="https://wg21.link/conv.lval">conv.lval</A>]), array-to-pointer
(7.3.3 [<A href="https://wg21.link/conv.array">conv.array</A>]), function-to-pointer (7.3.4 [<A href="https://wg21.link/conv.func">conv.func</A>]), <DEL>and</DEL> <INS>null pointer (7.3.12 [<A href="https://wg21.link/conv.ptr">conv.ptr</A>]), null member pointer (7.3.13 [<A href="https://wg21.link/conv.mem">conv.mem</A>]),
or</INS> boolean (7.3.14 [<A href="https://wg21.link/conv.fctptr">conv.fctptr</A>]) conversion<DEL>s</DEL>,
can be performed explicitly using <TT>static_cast</TT>. A program is
ill-formed...

</BLOCKQUOTE>

</OL>

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