Skip to content

CWG2889 [expr.delete] use of destroying delete requires accessible destructor #532

Description

@vasama

Full name of submitter: Lauri Vasama

Reference: [expr.delete]

Issue description:

If the value of the operand of the delete-expression is not a null pointer value and the selected deallocation function (see below) is not a destroying operator delete, evaluating the delete-expression invokes the destructor (if any) for the object or the elements of the array being deleted. The destructor shall be accessible from the point where the delete-expression appears.

The second sentence is not conditional on whether the selected deallocation function is a destroying operator delete, though it surely should be.

Suggested resolution:

Modify the sentence as follows:

If invoked, the destructor shall be accessible from the point where the delete-expression appears.

Related LLVM issue: llvm/llvm-project#46818

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions