<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1476</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="1476"></A><H4>1476.
  
Definition of user-defined type
</H4>
<B>Section: </B>Clause 3&#160; [<A href="https://wg21.link/intro.defs">intro.defs</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Lo&#239;c Joly
 &#160;&#160;&#160;

 <B>Date: </B>2012-03-08<BR>


<P>[Moved to DR at the April, 2013 meeting.]</P>

<P>The Standard uses the phrase, &#8220;user-defined type,&#8221; but it
is not clear what it is intended to mean.  For example,
16.4.5.2.1 [<A href="https://wg21.link/namespace.std#1">namespace.std</A>] paragraph 1 says,</P>

<BLOCKQUOTE>

A program may add a template specialization for any standard library
template to namespace <TT>std</TT> only if the declaration depends on a
user-defined type...

</BLOCKQUOTE>

<P>Are types defined in the Standard library &#8220;user-defined?&#8221;</P>

<P>9.2.9.3 [<A href="https://wg21.link/dcl.type.simple#2">dcl.type.simple</A>] paragraph 2 says,</P>

<BLOCKQUOTE>

The <TT>auto</TT> specifier is a placeholder for a type to be deduced
(9.2.9.7 [<A href="https://wg21.link/dcl.spec.auto">dcl.spec.auto</A>]). The other
<I>simple-type-specifier</I>s specify either a previously-declared
user-defined type or one of the fundamental types (6.9.2 [<A href="https://wg21.link/basic.fundamental">basic.fundamental</A>]).

</BLOCKQUOTE>

<P>implying that all non-fundamental types are &#8220;user-defined.&#8221;</P>

<P>A definition is needed, as well as a survey of uses of the term to
ensure consistency with the definition.</P>

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

<OL>
<LI><P>Change 9.2.9.3 [<A href="https://wg21.link/dcl.type.simple#2">dcl.type.simple</A>] paragraph 2 as follows:</P></LI>

<BLOCKQUOTE>

The <TT>auto</TT> specifier is a placeholder for a type to be deduced
(9.2.9.7 [<A href="https://wg21.link/dcl.spec.auto">dcl.spec.auto</A>]). The other
<I>simple-type-specifier</I>s specify either a previously-declared
<DEL>user-defined</DEL> type<INS>, a type determined from an
expression,</INS> or one of the fundamental types (6.9.2 [<A href="https://wg21.link/basic.fundamental">basic.fundamental</A>]). Table 10 summarizes the valid combinations of
<I>simple-type-specifier</I>s and the types they specify.

</BLOCKQUOTE>

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

<BLOCKQUOTE>

<P>[<I>Note:</I> For <DEL>user-defined</DEL> <INS>class</INS> types,
user-defined conversions are considered as well; see 11.4.8 [<A href="https://wg21.link/class.conv">class.conv</A>].  In general, an implicit conversion sequence
(12.2.4.2 [<A href="https://wg21.link/over.best.ics">over.best.ics</A>]) consists of a standard conversion
sequence followed by a user-defined conversion followed by another
standard conversion sequence.  &#8212;<I>end note</I>]
</P>

</BLOCKQUOTE>

<LI><P>Change the example in 12.2.2.3 [<A href="https://wg21.link/over.match.oper#1">over.match.oper</A>] paragraph 1
as follows:</P></LI>

<PRE>
  ...
  void f(void) {
    const char* p= "one" + "two";  //<SPAN CLASS="cmnt"> ill-formed because neither</SPAN>
                                   //<SPAN CLASS="cmnt"> operand has <DEL>user-defined</DEL> <INS>class or enumeration</INS> type</SPAN>
    int I = 1 + 1;                 //<SPAN CLASS="cmnt"> Always evaluates to </SPAN>2<SPAN CLASS="cmnt"> even if</SPAN>
                                   //<SPAN CLASS="cmnt"> <DEL>user-defined</DEL> <INS>class or enumeration</INS> types exist which</SPAN>
                                   //<SPAN CLASS="cmnt"> would perform the operation.</SPAN>
  }
</PRE>

</OL>

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