Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
t3nsor opened this issue Apr 24, 2023 · 1 comment · Fixed by cplusplus/draft#6328

Comments

@t3nsor
Copy link

t3nsor commented Apr 24, 2023

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]).

@jensmaurer
Copy link
Member

CWG2722

@jensmaurer jensmaurer changed the title [expr.unary.noexcept] Specification of noexcept operator is still unclear about temporary materialization conversion CWG2722 [expr.unary.noexcept] Specification of noexcept operator is still unclear about temporary materialization conversion Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants