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
[Adopted at the February/March, 2017 meeting.]
The resolution of issue 1489 added wording regarding value initialization to 6.9.3.2 [basic.start.static] paragraph 2 in an attempt to clarify the status of an example like
int a[1000]{};
However, this example is aggregate initialization, not value initialization. Also, now that we allow brace-or-equal-initializers in aggregates, this wording also needs to be updated to allow an aggregate with constant non-static data member initializers to qualify for constant initialization.
Proposed resolution (November, 2016):
Change 6.9.3.2 [basic.start.static] paragraph 2 as follows, converting the bulleted list into running text as indicated:
A constant initializer for
ana variable or temporary object o is anexpression thatinitializer whose full-expression is a constant expression, except thatitif o is an object, such an initializer may also invoke constexpr constructors for o and its subobjects even if those objects are of non-literal class types. [Note: Such a class may have a non-trivial destructor —end note] Constant initialization is performed:
if each full-expression (including implicit conversions) that appears in the initializer of a reference with static or thread storage duration is a constant expression (7.7 [expr.const]) and the reference is bound to a glvalue designating an object with static storage duration, to a temporary object (see 6.7.7 [class.temporary]) or subobject thereof, or to a function;if
ana variable or temporary object with static or thread storage duration is initialized by aconstructor call, and if the initialization full-expression is aconstant initializer for theobject;entity
if an object with static or thread storage duration is not initialized by a constructor call and if either the object is value-initialized or every full-expression that appears in its initializer is a constant expression.If constant initialization is not performed...
Change 7.7 [expr.const] paragraph 2 as follows:
A conditional-expressionAn expression e is a core constant expression unless...