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

2023-01-15


1363. Triviality vs multiple default constructors

Section: Clause 11  [class]     Status: CD3     Submitter: Sean Hunt     Date: 2011-08-16

[Moved to DR at the October, 2012 meeting.]

The requirements for a trivial class include having “a trivial default constructor” (Clause 11 [class] paragraph 6). However, with an explicitly-defaulted default constructor and other constructors with default arguments, it is possible to have multiple default constructors. Such a class cannot be default-initialized and thus should probably be considered non-trivial.

Proposed resolution (February, 2012):

Change Clause 11 [class] paragraph 6 as follows:

...A trivial class is a class that has a trivial default constructor (11.4.5 [class.ctor]), has no non-trivial default constructors, and is trivially copyable...