From Jason Turner

[class.default.ctor]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpx7l801_j/{from.md → to.md} +11 -20
tmp/tmpx7l801_j/{from.md → to.md} RENAMED
@@ -47,41 +47,32 @@ A default constructor is *trivial* if it is not user-provided and if:
47
  type (or array thereof), each such class has a trivial default
48
  constructor.
49
 
50
  Otherwise, the default constructor is *non-trivial*.
51
 
52
- A default constructor that is defaulted and not defined as deleted is
53
- *implicitly defined* when it is odr-used [[basic.def.odr]] to create an
54
- object of its class type [[intro.object]], when it is needed for
55
- constant evaluation [[expr.const]], or when it is explicitly defaulted
56
- after its first declaration. The implicitly-defined default constructor
57
  performs the set of initializations of the class that would be performed
58
  by a user-written default constructor for that class with no
59
  *ctor-initializer* [[class.base.init]] and an empty
60
  *compound-statement*. If that user-written default constructor would be
61
  ill-formed, the program is ill-formed. If that user-written default
62
- constructor would satisfy the requirements of a constexpr constructor
63
- [[dcl.constexpr]], the implicitly-defined default constructor is
64
- `constexpr`. Before the defaulted default constructor for a class is
65
- implicitly defined, all the non-user-provided default constructors for
66
- its base classes and its non-static data members are implicitly defined.
67
 
68
  [*Note 1*: An implicitly-declared default constructor has an exception
69
  specification [[except.spec]]. An explicitly-defaulted definition might
70
  have an implicit exception specification, see 
71
  [[dcl.fct.def]]. — *end note*]
72
 
73
- Default constructors are called implicitly to create class objects of
74
- static, thread, or automatic storage duration ([[basic.stc.static]],
75
- [[basic.stc.thread]], [[basic.stc.auto]]) defined without an initializer
76
- [[dcl.init]], are called to create class objects of dynamic storage
77
- duration [[basic.stc.dynamic]] created by a *new-expression* in which
78
- the *new-initializer* is omitted [[expr.new]], or are called when the
79
- explicit type conversion syntax [[expr.type.conv]] is used. A program is
80
- ill-formed if the default constructor for an object is implicitly used
81
- and the constructor is not accessible [[class.access]].
82
 
83
- [*Note 2*: [[class.base.init]] describes the order in which
84
  constructors for base classes and non-static data members are called and
85
  describes how arguments can be specified for the calls to these
86
  constructors. — *end note*]
87
 
 
47
  type (or array thereof), each such class has a trivial default
48
  constructor.
49
 
50
  Otherwise, the default constructor is *non-trivial*.
51
 
52
+ An implicitly-defined [[dcl.fct.def.default]] default constructor
 
 
 
 
53
  performs the set of initializations of the class that would be performed
54
  by a user-written default constructor for that class with no
55
  *ctor-initializer* [[class.base.init]] and an empty
56
  *compound-statement*. If that user-written default constructor would be
57
  ill-formed, the program is ill-formed. If that user-written default
58
+ constructor would be constexpr-suitable [[dcl.constexpr]], the
59
+ implicitly-defined default constructor is `constexpr`. Before the
60
+ defaulted default constructor for a class is implicitly defined, all the
61
+ non-user-provided default constructors for its base classes and its
62
+ non-static data members are implicitly defined.
63
 
64
  [*Note 1*: An implicitly-declared default constructor has an exception
65
  specification [[except.spec]]. An explicitly-defaulted definition might
66
  have an implicit exception specification, see 
67
  [[dcl.fct.def]]. — *end note*]
68
 
69
+ [*Note 2*: A default constructor is implicitly invoked to initialize a
70
+ class object when no initializer is specified [[dcl.init.general]]. Such
71
+ a default constructor is required to be accessible
72
+ [[class.access]]. *end note*]
 
 
 
 
 
73
 
74
+ [*Note 3*: [[class.base.init]] describes the order in which
75
  constructors for base classes and non-static data members are called and
76
  describes how arguments can be specified for the calls to these
77
  constructors. — *end note*]
78