﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">

<style type="text/css">

body { color: #000000; background-color: #FFFFFF; }
del { text-decoration: line-through; color: #8B0040; }
ins { text-decoration: underline; color: #005100; }

p.example { margin-left: 2em; }
pre.example { margin-left: 2em; }
div.example { margin-left: 2em; }

code.extract { background-color: #F5F6A2; }
pre.extract { margin-left: 2em; background-color: #F5F6A2;
  border: 1px solid #E1E28E; }

p.function { }
.attribute { margin-left: 2em; }
.attribute dt { float: left; font-style: italic;
  padding-right: 1ex; }
.attribute dd { margin-left: 0em; }

blockquote.std { color: #000000; background-color: #F1F1F1;
  border: 1px solid #D1D1D1;
  padding-left: 0.5em; padding-right: 0.5em; }
blockquote.stddel { text-decoration: line-through;
  color: #000000; background-color: #FFEBFF;
  border: 1px solid #ECD7EC;
  padding-left: 0.5empadding-right: 0.5em; ; }

blockquote.stdins { text-decoration: underline;
  color: #000000; background-color: #C8FFC8;
  border: 1px solid #B3EBB3; padding: 0.5em; }

table { border: 1px solid black; border-spacing: 0px;
  margin-left: auto; margin-right: auto; }
th { text-align: left; vertical-align: top;
  padding-left: 0.8em; border: none; }
td { text-align: left; vertical-align: top;
  padding-left: 0.8em; border: none; }

</style>

<title>Member initializers and aggregates</title>
</head>
<body>
<h1>Member initializers and aggregates</h1>

<p>
ISO/IEC JTC1 SC22 WG21 N3653 - 2013-04-17
</p>

<address>
Ville Voutilainen, ville.voutilainen@gmail.com
</address>

<address>
Richard Smith, richard@metafoo.co.uk
</address>

<h2><a name="Wording">Proposed Wording</a></h2>

<p>
Change in 8.5.1 (dcl.init.aggr) paragraph 1:
<blockquote>
An <i>aggregate</i> is an array or a class (Clause 9) with no user-provided
constructors (12.1), <del>no <i>brace-or-equal-initializers</i> for non-static
data members (9.2),</del> no private or protected non-static data
members (Clause 11), no base classes (Clause 10), and no virtual
functions (10.3).
</blockquote>

Change in 8.5.1 paragraph 7:
<blockquote>
If there are fewer <i>initializer-clause</i>s in the list than there are members
in the aggregate, then each member not explicitly initialized shall be
initialized <ins>from its <i>brace-or-equal-initializer</i> or, if there is no
<i>brace-or-equal-initializer</i>,</ins>
from an empty initializer list (8.5.4). [ Example:
<pre>
  struct S { int a; const char* b; int c; <ins>int d = b[a];</ins> };
  S ss = { 1, "asdf" };
</pre>
initializes ss.a with 1, ss.b with "asdf", <del>and</del> ss.c with the
value of an expression of the form int<del>(), </del><ins>{} (</ins>that is,
0<ins>), and ss.d with the value of ss.b[ss.a] (that is, 's'), and in
<pre>
  struct X { int i, j, k = 42; };
  X a[] = { 1, 2, 3, 4, 5, 6 };
  X b[2] = { { 1, 2, 3 }, { 4, 5, 6 } };
</pre>
<tt>a</tt> and <tt>b</tt> have the same value</ins>. -end example ]
</blockquote>
