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

2024-04-18


2216. Exception specifications in unevaluated contexts

Section: 14.5  [except.spec]     Status: NAD     Submitter: Daniel Krügler     Date: 2015-12-21

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:

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.

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.