A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/CWG/issues/1490.html below:

CWG Issue 1490

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

1490. List-initialization from a string literalSection: 9.5.5  [dcl.init.list]     Status: CD4     Submitter: Daveed Vandevoorde     Date: 2012-03-29

[Moved to DR at the November, 2014 meeting.]

Initialization of an array of characters from a string literal is handled by the third bullet of 9.5 [dcl.init] paragraph 16, branching off to 9.5.3 [dcl.init.string]. However, list initialization is handled by the first bullet, branching off to 9.5.5 [dcl.init.list], and there is no corresponding special case in 9.5.5 [dcl.init.list] paragraph 3 for an array of characters initialized by a brace-enclosed string literal. That is, an initialization like

  char s[4]{"abc"};

is ill-formed, which could be surprising. Similarly,

  std::initializer_list<char>{"abc"};

is plausible but also not permitted.

Notes from the October, 2012 meeting:

CWG agreed that the first example should be permitted, but not the second.

Proposed resolution (June, 2014):

This issue is resolved by the resolution of issue 1467.


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