<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2120</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="2120"></A><H4>2120.
  
Array as first non-static data member in standard-layout class
</H4>
<B>Section: </B>Clause 11&#160; [<A href="https://wg21.link/class">class</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Hubert Tong
 &#160;&#160;&#160;

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


<P>[Moved to DR at the October, 2015 meeting.]</P>

<P>The specification for determining whether a derived class
is a standard-layout class, considering the types of its bases
and those associated with its initial member, overlooked the
case of a class whose first member is an array.</P>

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

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

<BLOCKQUOTE>

<P>...<I>M</I>(<TT>X</TT>) is defined as follows:</P>

<UL>
<LI><P>If <TT>X</TT> is a non-union class type, the
set <I>M</I>(<TT>X</TT>) is empty if
<TT>X</TT> has no (possibly inherited (
11.7 [<A href="https://wg21.link/class.derived">class.derived</A>])) non-static data members;
otherwise, it consists of the type of the first non-static
data member of <TT>X</TT> (where said member may be an anonymous
union), <TT>X<SUB>0</SUB></TT>, and the elements of
<I>M</I>(<TT>X<SUB>0</SUB></TT>).</P></LI>

<LI><P>If <TT>X</TT> is a union type, the set <I>M</I>(<TT>X</TT>) is
the union of all <I>M</I>(<TT>U</TT><SUB><I>i</I></SUB>) and the set
containing all <TT>U</TT><SUB><I>i</I></SUB>, where each
<TT>U</TT><SUB><I>i</I></SUB> is the type of the <I>i</I>th
non-static data member of <TT>X</TT>.</P></LI>

<LI><P><INS>If <TT>X</TT> is an array type with element type
<TT>X<SUB>e</SUB></TT>, the set <I>M</I>(<TT>X</TT>) consists of
<TT>X<SUB>e</SUB></TT> and the elements of
<I>M</I>(<TT>X<SUB>e</SUB></TT>).</INS></P></LI>

<LI><P>If <TT>X</TT> is a non-class<INS>, non-array</INS> type, the
set <I>M</I>(<TT>X</TT>) is empty.</P></LI>

</UL>

<P>[<I>Note:</I> <I>M</I>(<TT>X</TT>) is the set of the types of all
non-base-class subobjects that are guaranteed in a
standard-layout class to be at a zero offset in
<TT>X</TT>. &#8212;<I>end note</I>]</P>

</BLOCKQUOTE>

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