Title
Is value-initialization of an array constant initialization?
Status
cd3
Section
6.9.3.2 [basic.start.static]
Submitter
Steve Adamczyk

Created on 2012-03-29.00:00:00 last changed 123 months ago

Messages

Date: 2013-04-15.00:00:00

[Moved to DR at the April, 2013 meeting.]

Date: 2012-10-15.00:00:00

Proposed resolution (October, 2012):

Change 6.9.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.

Date: 2016-02-15.00:00:00

According to 6.9.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.

History
Date User Action Args
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetmessages: + msg4371
2013-05-03 00:00:00adminsetstatus: ready -> dr
2012-11-03 00:00:00adminsetmessages: + msg4044
2012-11-03 00:00:00adminsetstatus: open -> ready
2012-03-29 00:00:00admincreate