CWG Issue 1354 (original) (raw)

This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118e. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2025-11-05


1354. Destructor exceptions for temporaries in noexcept expressions

Section: 7.6.2.7 [expr.unary.noexcept]Status: CD3Submitter: Sebastian RedlDate: 2011-08-16

[Moved to DR at the October, 2012 meeting.]

The result of the noexcept operator does not consider possible exceptions thrown by the destructors for temporaries created in the operand expression.

Proposed resolution (February, 2012):

  1. Change 6.10.1 [intro.execution] paragraph 10 as follows:

A full-expression is an expression that is not a subexpression of another expression. [_Note:_ in some contexts such as unevaluated operands, a syntactic subexpression is considered a full-expression (Clause 7 [expr]). —_end note_] If a language construct...

  1. Change Clause 7 [expr] paragraph 7 as follows:

...An unevaluated operand is not evaluated. An unevaluated operand is considered a full-expression. [Note:...

[Drafting note: This uniformly handles sizeof(A()),noexcept(A()), typeid(A()), anddecltype(A()) with regard to the semantic requirements on~A (accessible and not deleted), which might be checked via SFINAE. A programmer can use decltype(new A) to avoid considering the destructor. If this is undesired, an alternative change just addresses the noexecept issue:]

[Editing note: all the occurrences of “potentially evaluated” in 7.6.2.7 [expr.unary.noexcept] paragraph 3 should be hyphenated.]