CWG Issue 2905 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 118f. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-11-07
2905. Value-dependence of noexcept-expression
Section: 13.8.3.4 [temp.dep.constexpr]Status: CD7Submitter: Mital AshokDate: 2024-06-16
[Accepted as a DR at the November, 2024 meeting.]
(From submission#554.)
The following examples of _noexcept-expression_s are not specified to be value-dependent, but ought to be, because value-initialization of T might throw an exception.
template void f() { noexcept(static_cast(T{})); noexcept(typeid(*T{})); noexcept(delete T{}); }
Proposed resolution (approved by CWG 2024-11-19):
- Change in 13.8.3.4 [temp.dep.constexpr] paragraph 2 as follows:
Expressions of the following form are value-dependent if the unary-expression or expression is type-dependent or the type-id is dependent:
sizeof unary-expression
sizeof ( type-id )
typeid ( expression )
typeid ( type-id )
alignof ( type-id )noexcept ( expression ) - Change in 13.8.3.4 [temp.dep.constexpr] paragraph 3 as follows:
Expressions of the following form are value-dependent if either the type-id
or, simple-type-specifier, or typename-specifier is dependent or the expression or cast-expression is value-dependent or any expression in the expression-list is value-dependent or any assignment-expression in the braced-init-list is value-dependent:simple-type-specifier ( expression-listopt )
typename-specifier ( _expression-list_opt )
simple-type-specifier braced-init-list
typename-specifier braced-init-list
static_cast < _type-id_ > ( expression )
const_cast < _type-id_ > ( expression )
reinterpret_cast < _type-id_ > ( expression )
dynamic_cast < _type-id_ > ( expression )
( type-id ) cast-expression - Add a new paragraph before 13.8.3.4 [temp.dep.constexpr] paragraph 5 as follows:
A noexcept-expression (7.6.2.7 [expr.unary.noexcept]) is value-dependent if its expression involves a template parameter.
An expression of the form &qualified-id where ...