Title
Exception specifications in unevaluated contexts
Status
nad
Section
14.5 [except.spec]
Submitter
Daniel Krügler

Created on 2015-12-21.00:00:00 last changed 83 months ago

Messages

Date: 2016-11-15.00:00:00

Rationale (November, 2016):

The type of the function is needed to know how to call it, and the exception specification is part of the function type.

Date: 2022-11-20.07:54:16

Consider:

  #include <type_traits>

  template<class T>
  T foo(T) noexcept(std::is_nothrow_move_constructible<T>::value);

  int main()
  {
   sizeof(foo(0));
  }
According to 14.5 [except.spec] paragraph 13:
An exception specification is considered to be needed when:
  • in an expression, the function is selected by overload resolution (12.2 [over.match], 12.3 [over.over]);
  • ...

Is it intended that the exception specification is needed for the example? The function call is never evaluated and the exception specification is not queried.

History
Date User Action Args
2018-02-27 00:00:00adminsetmessages: + msg6022
2018-02-27 00:00:00adminsetstatus: open -> nad
2015-12-21 00:00:00admincreate