This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-08-11
1489. Is value-initialization of an array constant initialization?Section: 6.10.3.2 [basic.start.static] Status: CD3 Submitter: Steve Adamczyk Date: 2012-03-29[Moved to DR at the April, 2013 meeting.]
According to 6.10.3.2 [basic.start.static] paragraph 2,
Constant initialization is performed:
...
if an object with static or thread storage duration is not initialized by a constructor call and if every full-expression that appears in its initializer is a constant expression.
Presumably this would include a value-initialization (i.e., with no expressions) such as
int a[1000]{};
However, we have recently clarified the degenerate cases of other similar rules referencing “every,” so it wouldn't hurt to be more explicit here.
Proposed resolution (October, 2012):
Change 6.10.3.2 [basic.start.static] paragraph 2 as follows:
Constant initialization is performed:
...
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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4