This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 115e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-11-11


1421. Full expressions and aggregate initialization

Section: 9.4.5  [dcl.init.list]     Status: NAD     Submitter: Jason Merrill     Date: 2011-12-03

Dealing with aggregate-initialized temporaries has been a bit of a headache because unlike aggregate initialization of variables, each element initialization is not a full-expression, so various things behave differently because they are in the context of initializing a temporary.

This can either be inconsistent with aggregate initialization of a variable (in which each element is a full-expression) or inconsistent with list-initialization via constructor (in which each element is a subexpression).

Rationale (October, 2012):

The rules are acceptable as written; declaration and expression contexts are different.