This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2024-12-19
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.
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.