Created on 2023-06-20.00:00:00 last changed 1 week ago
CWG 2026-05-19
For e.g. a virtual base class VB that inherits constructors, the vtable will not be in its final state while executing inheriting constructors of VB, therefore 11.9.5 [class.cdtor] paragraph 4 through 6 are correct as written.
Proposed resolution (approved by CWG 2026-05-19):
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.8.4 [basic.life]) before all delegating constructors have completed. -- end note]
Change in 6.8.4 [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.5 [dcl.init], 11.9.3 [class.base.init]),
Change in 11.9.5 [class.cdtor] paragraph 2 as follows:
During theconstructioninitialization of an object, if the value of the object or any of its subobjects is accessed through a glvalue that is not obtained, directly or indirectly, from the constructor's this pointer, the value of the object or subobject thus obtained is unspecified.
CWG 2023-10-20
Utterances about "during construction or destruction" in 11.9.5 [class.cdtor] need to be adjusted.
Proposed resolution (approved by CWG 2023-07-14) [SUPERSEDED]:
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.8.4 [basic.life]) before all delegating constructors have completed. -- end note]
Change in 6.8.4 [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.5 [dcl.init], 11.9.3 [class.base.init]),
Subclause 6.8.4 [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.5 [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 |
| 2026-05-20 07:13:21 | admin | set | messages: + msg8585 |
| 2026-05-20 07:13:21 | admin | set | status: review -> tentatively ready |
| 2025-11-06 23:04:52 | admin | set | messages: + msg8249 |
| 2023-10-20 21:07:14 | admin | set | messages: + msg7469 |
| 2023-10-20 21:07:14 | admin | set | status: tentatively ready -> review |
| 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 | |