<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 1860</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="1860"></A><H4>1860.
  
What is a &#8220;direct member?&#8221;
</H4>
<B>Section: </B>11.5&#160; [<A href="https://wg21.link/class.union">class.union</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Dawn Perchik
 &#160;&#160;&#160;

 <B>Date: </B>2014-02-13<BR>


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

<P>The term &#8220;direct member&#8221; is used in 11.5 [<A href="https://wg21.link/class.union#8">class.union</A>] paragraph 8
but is not defined.  It might be better to refer to the class's
<I>member-specification</I> instead.</P>

<P><B>Additional note, October, 2015:</B></P>

<P>This issue is expected to be addressed by the wording of N4532 or
a successor thereof (&#8220;Default Comparisons&#8221;).</P>

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

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

<BLOCKQUOTE>

<P>The <I>elements</I> of an aggregate are:</P>

<UL>
<LI><P>for an array, the array elements in increasing
subscript order, or</P></LI>

<LI><P>for a class, the direct base classes in declaration order
followed by the direct <INS>non-static data</INS>
members <INS>that are not members of an anonymous union,</INS>
in declaration order.</P></LI>

</UL>

</BLOCKQUOTE>

<LI>
<P>Change 11.4 [<A href="https://wg21.link/class.mem#1">class.mem</A>] paragraph 1 as follows:</P>
</LI>

<BLOCKQUOTE>

The <I>member-specification</I> in a class definition
declares the full set of members of the class; no member can
be added elsewhere. <INS>A
<I>direct member</I> of a class <TT>X</TT> is a member of <TT>X</TT>
that was first declared within the <I>member-specification</I> of
<TT>X</TT>, including anonymous union objects and direct
members thereof.</INS> Members of a class are...

</BLOCKQUOTE>

<LI>
<P>Change 11.5.2 [<A href="https://wg21.link/class.union.anon#1">class.union.anon</A>] paragraph 1 as follows:</P>
</LI>

<BLOCKQUOTE>

<P>A union of the form</P>

<UL>
<TT>union {</TT> <I>member-specification</I> <TT>} ;</TT>
</UL>

<P>is called an <I>anonymous union</I>; it defines an
unnamed <INS>type and an unnamed</INS> object of <DEL>unnamed</DEL>
<INS>that</INS> type <INS>called an <I>anonymous union
object</I></INS>. Each <I>member-declaration</I> in
the <I>member-specification</I> of an anonymous union</P>...

</BLOCKQUOTE>

</OL>

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