This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 112e. See for the official list.


1497. Aggregate initialization with parenthesized string literal

Section: 9.4.2  [dcl.init.aggr]     Status: NAD     Submitter: Daveed Vandevoorde     Date: 2012-04-25

Existing practice appears to be to allow C++03-style aggregate initialization from a parenthesized string literal, e.g.,

  struct S {
    char arr[4];
  } s = {("abc")};

This should be standardized, to allow examples like

  struct S {
    char arr[4];
  void f(S);
  void g() {

Rationale (October, 2012):

CWG agreed that this is already permitted by virtue of _N4567_.5.1.1 [expr.prim.general] paragraph 6.