A RetroSearch Logo

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

Search Query:

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

CWG Issue 1301

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-04-13

1301. Value initialization of unionSection: 9.5  [dcl.init]     Status: CD3     Submitter: Jason Merrill     Date: 2011-04-18

[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]

According to 9.5 [dcl.init] paragraph 7,

To value-initialize an object of type T means:

This suggests that for

  struct A { A() = delete; };
  union B { A a };
  int main()
  {
    B();
  }

a B temporary is created and zero-initialized, even though its default constructor is deleted. We should strike "non-union" and also the "if...non-trivial" condition, since we can have a trivial deleted constructor.

Proposed resolution (August, 2011):

  1. Change 9.5 [dcl.init] paragraph 7 as follows:

  2. To value-initialize an object of type T means:

  3. Change 9.5.5 [dcl.init.list] paragraph 3 as follows:

  4. List-initialization of an object or reference of type T is defined as follows:

This resolution also resolves issues 1324 and 1368.


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