Skip to content

[class.base.init] Overzealous UB on constructor preconditions/destructor postconditions #948

Description

@notadragon

Full name of submitter (unless configured in github; will be published with the issue): Joshua Berne

Reference (section label): class.base.init

Link to reflector thread (if any):

Issue description: The precondition of a consructor and postcondition of a destructor cases added to this section apply, as written, to all constructors and destructors but should really apply to the object under construction/destruction.

Suggested resolution:

Add in "of the object under construction" and "of the object under destruction" where appropriate. (It should remain "a constructor" because this applies to delegating constructors as well, but switch to "the destructor" because there is only one).

In [classbase.init] paragraph 18:

Member functions (including virtual member functions, [class.virtual]) can be called for an object under construction or destruction. Similarly, an object under construction or destruction can be the operand of the typeid operator ([expr.typeid]) or of a dynamic_cast ([expr.dynamic.cast]). However, if these operations are performed during evaluation of

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions