<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2094</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="2094"></A><H4>2094.
  
Trivial copy/move constructor for class with volatile member
</H4>
<B>Section: </B>11.4.5.3&#160; [<A href="https://wg21.link/class.copy.ctor">class.copy.ctor</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Daveed Vandevoorde
 &#160;&#160;&#160;

 <B>Date: </B>2015-03-06<BR>


<P>[Moved to DR at the November, 2016 meeting.]</P>

<P>The resolution of <A HREF="496.html">issue 496</A>
included the addition of 11.4.5.3 [<A href="https://wg21.link/class.copy.ctor#25">class.copy.ctor</A>] paragraph 25.
2, making a class's copy/move constructor
non-trivial if it has a non-static data member of
volatile-qualified type.  This change breaks the IA-64 ABI,
so it has been requested that CWG reconsider this aspect of the
resolution.</P>

<P>On a related note, the resolution of
<A HREF="496.html">issue 496</A> also changed
6.9 [<A href="https://wg21.link/basic.types#9">basic.types</A>] paragraph 9, which makes
volatile-qualified scalar types &#8220;trivial&#8221; but
not &#8220;trivially copyable.&#8221; It is not clear why
there is a distinction made here; the only actual use of
&#8220;trivial type&#8221; in the Standard appears to be in
the description of <TT>qsort</TT>, which should probably use
&#8220;trivially copyable.&#8221; (See also
<A HREF="1746.html">issue 1746</A>.)</P>

<P><B>Notes from the February, 2016 meeting:</B></P>

<P>CWG agreed with the suggested direction for the changes in
11.4.5.3 [<A href="https://wg21.link/class.copy.ctor">class.copy.ctor</A>]; the use of &#8220;trivial&#8221; will
be dealt with separately and not as part of the resolution of this
issue.</P>

<P><B>Proposed resolution (June, 2016):</B></P>

<OL>
<LI><P>Change 6.9 [<A href="https://wg21.link/basic.types#9">basic.types</A>] paragraph 9 as follows:</P></LI>

<BLOCKQUOTE>

...called POD types. Cv-unqualified scalar types, trivially copyable class
types (Clause 11 [<A href="https://wg21.link/class">class</A>]), arrays of such types, and
<DEL>non-volatile const-qualified</DEL> <INS>cv-qualified</INS> versions of
these types (6.9.5 [<A href="https://wg21.link/basic.type.qualifier">basic.type.qualifier</A>]) are collectively
called <I>trivially copyable types</I>. Scalar types...

</BLOCKQUOTE>

<LI><P>Delete bullet 12.2 of 11.4.5.3 [<A href="https://wg21.link/class.copy.ctor">class.copy.ctor</A>]:</P></LI>

<BLOCKQUOTE>

<P>A copy/move constructor for class <TT>X</TT> is trivial if it is not
user-provided, its parameter-type-list is equivalent to the
parameter-type-list of an implicit declaration, and if</P>

<UL>
<LI><P>...</P></LI>

<LI><P><DEL>class <TT>X</TT> has no non-static data members of volatile-qualified type, and</DEL></P></LI>

<LI><P>...</P></LI>

</UL>

</BLOCKQUOTE>

<LI><P>Delete bullet 25.2 of 11.4.5.3 [<A href="https://wg21.link/class.copy.ctor">class.copy.ctor</A>]:</P></LI>

<BLOCKQUOTE>

<P>A copy/move assignment operator for class <TT>X</TT> is trivial if it is
not user-provided, its parameter-type-list is equivalent to the
parameter-type-list of an implicit declaration, and if</P>

<UL>
<LI><P>...</P></LI>

<LI>

<P><DEL>class <TT>X</TT> has no non-static data members of
volatile-qualified type, and</DEL></P>
</LI>

</UL>

</BLOCKQUOTE>

</OL>

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