<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1496</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="1496"></A><H4>1496.
  
Triviality with deleted and missing default constructors
</H4>
<B>Section: </B>11.3&#160; [<A href="https://wg21.link/class.name">class.name</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Daniel Kr&#252;gler
 &#160;&#160;&#160;

 <B>Date: </B>2012-04-25<BR>


<P>[Adopted at the February, 2016 meeting.]</P>



<P>A default constructor that is defined as deleted is trivial, according
to 11.4.5 [<A href="https://wg21.link/class.ctor#5">class.ctor</A>] paragraph 5. This means that, according
to Clause 11 [<A href="https://wg21.link/class#6">class</A>] paragraph 6, such a class can be trivial.
If, however, the class has no default constructor because it has a
user-declared constructor, the class is not trivial.  Since both cases
prevent default construction of the class, it is not clear why there is
a difference in triviality between the cases.</P>

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

<P><B>Notes from the October, 2012 meeting:</B></P>

<P>It was observed that this issue was related to <A HREF="1344.html">issue 1344</A>, as the current specification allows adding
a default constructor by adding default arguments to the definition of
a constructor.  The resolution of that issue should also resolve this
one.</P>

<P><B>Notes from the September, 2013 meeting:</B></P>

<P>It was decided to resolve <A HREF="1344.html">issue 1344</A>
separately from this issue, so this issue now requires its own
resolution.</P>

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

<P>Change Clause 11 [<A href="https://wg21.link/class#6">class</A>] paragraph 6 as follows:</P>

<BLOCKQUOTE>

A <I>trivial class</I> is a class that <DEL>has a default
constructor (11.4.5 [<A href="https://wg21.link/class.ctor">class.ctor</A>]), has no non-trivial
default constructors, and</DEL> is trivially copyable <INS>
and has one or more default constructors
(11.4.5 [<A href="https://wg21.link/class.ctor">class.ctor</A>]), all of which are either trivial
or deleted and at least one of which is not
deleted</INS>. [<I>Note:</I> In particular, a trivially
copyable or trivial class does not have virtual functions or
virtual base classes. &#8212;<I>end note</I>]

</BLOCKQUOTE>

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