Skip to content

CWG2722 [expr.unary.noexcept] Specification of noexcept operator is still unclear about temporary materialization conversion #301

Closed
cplusplus/draft
#6328
@t3nsor

Description

@t3nsor

Full name of submitter: Brian Bi

Reference (section label): [expr.unary.noexcept]

Issue description: The drafting note for CWG 1354 says that noexcept(A()) requires the destructor of A to be accessible and non-deleted, which seems to imply that the temporary materialization conversion is applied to the prvalue A(). However, while the resolution to CWG 1354 undoubtedly requires the destruction of temporaries created within an unevaluated operand, there is no normative wording that requires the temporary materialization conversion to be performed on the operand of noexcept. In contrast, there is already normative wording stating that the operands of sizeof and typeid are subject to the temporary materialization conversion, and that the operand of decltype is not.

Suggested resolution: Edit [expr.unary.noexcept]/3:

If the operand is a prvalue, the temporary materialization conversion ([conv.rval]) is applied. The result of the noexcept operator is true unless the expression (including any temporary materialization conversion) is potentially-throwing ([except.spec]).

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