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

2024-10-26


1978. Redundant description of explicit constructor use

Section: 11.4.8.2  [class.conv.ctor]     Status: CD4     Submitter: Geoffrey Romer     Date: 2014-07-22

[Moved to DR at the May, 2015 meeting.]

The conditions under which an explicit constructor will be used are given in 11.4.8.2 [class.conv.ctor] paragraph 2:

An explicit constructor constructs objects just like non-explicit constructors, but does so only where the direct-initialization syntax (9.4 [dcl.init]) or where casts (7.6.1.9 [expr.static.cast], 7.6.3 [expr.cast]) are explicitly used. A default constructor may be an explicit constructor; such a constructor will be used to perform default-initialization or value-initialization (9.4 [dcl.init]).

The existence of this wording in normative text is confusing and should probably simply say that explicit constructors are used in direct initialization, with cross-references to 9.4 [dcl.init] and 12.2.2.5 [over.match.copy], possibly as a note.

Proposed resolution (April, 2015):

Change 11.4.8.2 [class.conv.ctor] paragraph 2 as follows:

[Note: An explicit constructor constructs objects just like non-explicit constructors, but does so only where the direct-initialization syntax (9.4 [dcl.init]) or where casts (7.6.1.9 [expr.static.cast], 7.6.3 [expr.cast]) are explicitly used; see also 12.2.2.5 [over.match.copy]. A default constructor may be an explicit constructor; such a constructor will be used to perform default-initialization or value-initialization (9.4 [dcl.init]). [Example: ... —end example] end note]