Title
Value-dependence of noexcept-expression
Status
ready
Section
13.8.3.4 [temp.dep.constexpr]
Submitter
Mital Ashok

Created on 2024-06-16.00:00:00 last changed yesterday

Messages

Date: 2024-11-19.08:37:02

Proposed resolution (approved by CWG 2024-11-19):

  1. 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 )
    
  2. 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-listopt )
    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
    
  3. 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 ...

Date: 2024-06-27.04:48:19

(From submission #554.)

The following examples of noexcept-expressions are not specified to be value-dependent, but ought to be, because value-initialization of T might throw an exception.

  template<typename T>
  void f() {
    noexcept(static_cast<int>(T{}));
    noexcept(typeid(*T{}));
    noexcept(delete T{});
  }
History
Date User Action Args
2024-11-19 12:01:24adminsetstatus: tentatively ready -> ready
2024-06-27 04:48:19adminsetmessages: + msg7760
2024-06-27 04:48:19adminsetstatus: open -> tentatively ready
2024-06-16 00:00:00admincreate