<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1145</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="1145"></A><H4>1145.
  
Defaulting and triviality
</H4>
<B>Section: </B>11.4.5&#160; [<A href="https://wg21.link/class.ctor">class.ctor</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>FI
 &#160;&#160;&#160;

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


<P>[Voted into the WP at the March, 2011 meeting.]</P>

<A href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3296.html#FI4">N3092 comment
  FI&#160;4<BR></A>

<P>What effect does defaulting have on triviality? Related
to <A HREF="1135.html">issue 1135</A>, non-public special
members defaulted on their first declaration should retain
triviality, because they shouldn't be considered
user-provided. Related to <A HREF="1137.html">issue 1137</A>, defaulted member functions that are virtual
should not be considered trivial, but there's no reason why
non-virtuals could not be.</P>

<P>Furthermore, a class with a non-public explicitly-defaulted
constructor isn't ever trivially constructible under the
current rules. If such a class is used as a subobject, the
constructor of the aggregating class should be trivial if it
can access the non-public explicitly defaulted constructor
of a subobject.</P>

<P>
<U>Suggested resolution</U>: Change the triviality rules
so that a class can have a trivial default constructor if
the class has access to the default constructors of its
subobjects and the default constructors of the subobjects
are explicitly defaulted on first declaration, even if said
defaulted constructors are non-public.</P>

<P>See also <A HREF="1149.html">issue 1149</A>.</P>

<P><B>Rationale (August, 2010):</B></P>

<P>The consensus of the CWG was that this change should not be
made at this point in the standardization process, but that it
might be considered at a later date.</P>

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

<P>This issue is resolved by the resolution of <A HREF="1135.html">issue 1135</A>.</P>

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