<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<TITLE>
    CWG Issue 2610</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="2610"></A><H4>2610.
  
Indirect private base classes in aggregates
</H4>
<B>Section: </B>9.5.2&#160; [<A href="https://wg21.link/dcl.init.aggr">dcl.init.aggr</A>]
 &#160;&#160;&#160;

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

 <B>Submitter: </B>Chris Bowler
 &#160;&#160;&#160;

 <B>Date: </B>2022-07-21<BR>


<P>[Accepted as a DR at the November, 2022 meeting.]</P>



<P>The wording appears to prohibit aggregates from having indirect
private base classes.  That does not match existing practice and is an
unnecessary restriction. For example:</P>

<PRE>
#include &lt;type_traits&gt;

struct B1 {};
struct B2 : private B1 {};
struct S : public B2 {};

void f() {
  static_assert(std::is_aggregate&lt;S&gt;::value);
}
</PRE>

<P><B>Proposed resolution (approved by CWG 2022-08-26):</B></P>

<P>Change in 9.5.2 [<A href="https://wg21.link/dcl.init.aggr">dcl.init.aggr</A>] paragraph 1 as follows:</P>

<BLOCKQUOTE>

An aggregate is an array or a class (Clause 11 [<A href="https://wg21.link/class">class</A>]) with

<UL>
<LI>no user-declared or inherited constructors
(11.4.5 [<A href="https://wg21.link/class.ctor">class.ctor</A>]),</LI>

<LI>no private or protected direct non-static data members
(11.8 [<A href="https://wg21.link/class.access">class.access</A>]),</LI>

<LI><INS>no private or protected direct base classes
(11.8.3 [<A href="https://wg21.link/class.access.base">class.access.base</A>]), and</INS></LI>

<LI>no virtual functions (11.7.3 [<A href="https://wg21.link/class.virtual">class.virtual</A>])
<INS>or virtual base classes
(11.7.2 [<A href="https://wg21.link/class.mi">class.mi</A>]).</INS><DEL>, and</DEL>
</LI>

<LI><DEL>no virtual, private, or protected base classes
(11.7.2 [<A href="https://wg21.link/class.mi">class.mi</A>]).</DEL></LI>
</UL>

</BLOCKQUOTE>

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