<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 63</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="63"></A><H4>63.
  
Class instantiation from pointer conversion to void*, null and self
</H4>
<B>Section: </B>13.9.2&#160; [<A href="https://wg21.link/temp.inst">temp.inst</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Steve Adamczyk
 &#160;&#160;&#160;

 <B>Date: </B>13 Oct 1998<BR>



<P>[Moved to DR at October 2002 meeting.]</P>

<P>A template is implicitly instantiated because of a "pointer conversion"
on an argument. This was intended to include related-class conversions,
but it also inadvertently includes conversions to <TT>void*, </TT>null
pointer conversions, cv-qualification conversions and the identity conversion.</P>

<P>It is not clear whether a <TT>reinterpret_cast</TT> of a pointer should
cause implicit instantiation.</P>

<P>
<B>Proposed resolution (10/01):</B> Replace
13.9.2 [<A href="https://wg21.link/temp.inst#4">temp.inst</A>] paragraph 4,
 up to the
example, with the following:</P>
<BLOCKQUOTE>
A class template specialization is implicitly instantiated if the
class type is used in a context that requires a completely-defined
object type or if the completeness of the class type might affect the
semantics of the program.  [<I>Note:</I> in particular, if the
semantics of an expression depend on the member or base class lists
of a class template specialization, the class template specialization
is implicitly generated.  For instance, deleting a pointer to class
type depends on whether or not the class declares a destructor, and
conversion between pointer to class types depends on the inheritance
relationship between the two classes involved. ]
</BLOCKQUOTE>

<P>This version differs from the previous version is its use of the
word "might" in the first sentence.</P>

<P>(See also <A HREF="212.html">issue 212</A>.)</P>

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