Created on 2013-05-05.00:00:00 last changed 83 months ago
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...
[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.
History | |||
---|---|---|---|
Date | User | Action | Args |
2018-02-27 00:00:00 | admin | set | status: ready -> c++17 |
2017-02-06 00:00:00 | admin | set | messages: + msg5714 |
2017-02-06 00:00:00 | admin | set | status: drafting -> ready |
2013-10-14 00:00:00 | admin | set | status: open -> drafting |
2013-05-05 00:00:00 | admin | create |