<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    Core "tentatively ready" Issues
   </TITLE>
</HEAD>
<BODY>
<TABLE ALIGN="RIGHT" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD ALIGN="RIGHT">
      Document number:
     </TD>
<TD>
       &#160;P0520R0</TD>
</TR>
<TR>
<TD ALIGN="RIGHT">
      Date:
     </TD>
<TD>
      &#160;2016-11-11</TD>
</TR>
<TR>
<TD ALIGN="RIGHT">
      Project:
     </TD>
<TD>
      &#160;Programming Language C++
     </TD>
</TR>
<TR>
<TD ALIGN="RIGHT">
      Reference:
     </TD>
<TD>
      &#160;ISO/IEC IS 14882:2014
     </TD>
</TR>
<TR>
<TD ALIGN="RIGHT">
      Reply to:
     </TD>
<TD>
      &#160;William M. Miller
     </TD>
</TR>
<TR>
<TD></TD>
<TD>
      &#160;Edison Design Group, Inc.
     </TD>
</TR>
<TR>
<TD></TD>
<TD>
      &#160;<A HREF="mailto://wmm@edg.com">wmm@edg.com</A></TD>
</TR>
</TABLE><BR CLEAR="ALL"><BR><CENTER>
<H2>
     Core Language Working Group "tentatively ready" Issues
     for the
     November, 2016 (Issaquah) meeting
    </H2>
</CENTER><BR><P>
    Section references in this document reflect the section numbering
    of document
    <A HREF="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4567.pdf">WG21 N4582</A>.
   </P>
<HR><A NAME="2094"></A><H4>2094.
  
Trivial copy/move constructor for class with volatile member
</H4><B>Section: </B>12.8&#160; [class.copy]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

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

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


<P>The resolution of issue 496
included the addition of 12.8 [class.copy]
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
issue 496 also changed
3.9 [basic.types] 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
issue 1746.)</P>

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

<P>CWG agreed with the suggested direction for the changes in
12.8 [class.copy]; 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 3.9 [basic.types] paragraph 9 as follows:</P></LI>

<BLOCKQUOTE>

...called POD types. Cv-unqualified scalar types, trivially copyable class
types (Clause 9 [class]), arrays of such types, and
<SPAN style="text-decoration:line-through;background-color:#FFA0A0">non-volatile const-qualified</SPAN> <SPAN style="font-weight:bold;background-color:#A0FFA0">cv-qualified</SPAN> versions of
these types (3.9.3 [basic.type.qualifier]) are collectively
called <I>trivially copyable types</I>. Scalar types...

</BLOCKQUOTE>

<LI><P>Delete bullet 12.2 of 12.8 [class.copy]:</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><SPAN style="text-decoration:line-through;background-color:#FFA0A0">class <TT>X</TT> has no non-static data members of volatile-qualified type, and</SPAN></P></LI>

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

</UL>

</BLOCKQUOTE>

<LI><P>Delete bullet 25.2 of 12.8 [class.copy]:</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><SPAN style="text-decoration:line-through;background-color:#FFA0A0">class <TT>X</TT> has no non-static data members of
volatile-qualified type, and</SPAN></P></LI>

</UL>

</BLOCKQUOTE>

</OL>

<BR><BR><HR><A NAME="2100"></A><H4>2100.
  
Value-dependent address of static data member of class template
</H4><B>Section: </B>14.6.2.3&#160; [temp.dep.constexpr]
 &#160;&#160;&#160;

 <B>Status: </B>tentatively ready
 &#160;&#160;&#160;

 <B>Submitter: </B>Richard Smith
 &#160;&#160;&#160;

 <B>Date: </B>2015-03-16




<P>According to bullet 2.4 of 14.6.2.3 [temp.dep.constexpr], an
<I>id-expression</I> is value-dependent if</P>

<UL><LI><P>it names a static data member that is a dependent
member of the current instantiation and is not initialized
in a <I>member-declarator</I>,</P></LI></UL>

<P>This implies that the address of an initialized static data
member is not value-dependent, which is incorrect.</P>

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

<P>Change 14.6.2.3 [temp.dep.constexpr] paragraph 5 as follows:</P>

<BLOCKQUOTE>

<P>An expression of the form <TT>&amp;</TT><I>qualified-id</I> where
the <I>qualified-id</I> names a dependent member of the current
instantiation is value-dependent. <SPAN style="font-weight:bold;background-color:#A0FFA0">An expression of the form</SPAN></P>

<UL><SPAN style="font-weight:bold;background-color:#A0FFA0"><TT>&amp;</TT><I>cast-expression</I></SPAN></UL>

<P><SPAN style="font-weight:bold;background-color:#A0FFA0">is also value-dependent if evaluating <I>cast-expression</I> as a
core constant expression (5.20 [expr.const]) succeeds and the
result of the evaluation refers to a templated entity that is an object
with static or thread storage duration or a member function.</SPAN></P>

</BLOCKQUOTE>

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