Title
Implicitly-declared default constructors and explicit
Status
cd4
Section
11.4.5 [class.ctor]
Submitter
Daniel Krügler

Created on 2014-03-04.00:00:00 last changed 49 months ago

Messages

Date: 2015-05-15.00:00:00

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

Date: 2014-11-15.00:00:00

Proposed resolution (November, 2014):

  1. Change 11.4.5 [class.ctor] paragraph 4 as follows:

  2. A default constructor for a class X is a constructor of class X that can be called without an argument. If there is no user-declared constructor for class X, a non-explicit constructor having no parameters is implicitly declared as defaulted (9.5 [dcl.fct.def]). An implicitly-declared default constructor...
  3. Change 11.4.8.2 [class.conv.ctor] paragraph 3 as follows:

  4. A non-explicit copy/move constructor (_N4750_.15.8 [class.copy]) is a converting constructor. [Note: An implicitly-declared copy/move constructor is not an explicit constructor; it may be called for implicit type conversions. end note]
  5. Change _N4750_.15.8 [class.copy] paragraph 7 as follows:

  6. If the class definition does not explicitly declare a copy constructor, a non-explicit one is declared implicitly. If the class...
  7. Change _N4750_.15.8 [class.copy] paragraph 9 as follows:

  8. If the definition of a class X does not explicitly declare a move constructor, a non-explicit one will be implicitly declared as defaulted if and only if...
Date: 2020-12-15.00:00:00

It used to be clear that an implicitly-declared default constructor is not explicit. That has been inadvertently lost due to other changes, so this specification should be added to 11.4.5 [class.ctor] in parallel with the similar statement in _N4750_.15.8 [class.copy] paragraph 3.

History
Date User Action Args
2017-02-06 00:00:00adminsetstatus: drwp -> cd4
2015-11-10 00:00:00adminsetstatus: dr -> drwp
2015-05-25 00:00:00adminsetmessages: + msg6054
2015-05-25 00:00:00adminsetstatus: tentatively ready -> dr
2014-11-24 00:00:00adminsetmessages: + msg5166
2014-11-24 00:00:00adminsetstatus: drafting -> tentatively ready
2014-07-07 00:00:00adminsetstatus: open -> drafting
2014-03-04 00:00:00admincreate