Created on 2023-06-20.00:00:00 last changed 2 months ago
Proposed resolution (approved by CWG 2023-07-14):
Split and change 11.9.3 [class.base.init] paragraph 9 as follows:
[Note 3: An abstract class ... -- end note ]
An attempt to initialize more than one non-static data member of a union renders the program ill-formed.[Note 4: After the call to a constructor for class X ... -- end note ] [Example 6: ... -- end example ]An attempt to initialize more than one non-static data member of a union renders the program ill-formed.
An object's initialization is considered complete when a non-delegating constructor for that object returns. [Note: Therefore, an object's lifetime can begin (6.7.3 [basic.life]) before all delegating constructors have completed. -- end note]
Change in 6.7.3 [basic.life] bullet 1.2 as follows:
... The lifetime of an object of type T begins when:except that ...
- storage with the proper alignment and size for type T is obtained, and
- its initialization (if any) is complete (including vacuous initialization) (9.4 [dcl.init], 11.9.3 [class.base.init]),
Subclause 6.7.3 [basic.life] paragraph 1 specifies:
... The lifetime of an object of type T begins when:except that ...
- storage with the proper alignment and size for type T is obtained, and
- its initialization (if any) is complete (including vacuous initialization) (9.4 [dcl.init]),
It is unclear whether initialization is considered complete when the (ultimate) target constructor completes, or when the outermost delegating constructor completes. Subclause 14.3 [except.ctor] paragraph 4 suggests it is the former:
If the compound-statement of the function-body of a delegating constructor for an object exits via an exception, the object's destructor is invoked. ...
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-07-14 22:46:13 | admin | set | status: open -> tentatively ready |
2023-06-30 14:12:45 | admin | set | messages: + msg7348 |
2023-06-20 00:00:00 | admin | create |