Created on 2013-09-24.00:00:00 last changed 95 months ago
[Moved to DR at the November, 2014 meeting.]
Proposed resolution (February, 2014):
Change 14.5 [except.spec] paragraph 12 as follows:
A function with no exception-specification or with an exception-specification of the form noexcept(constant-expression ) where the constant-expression yields false allows all exceptions. An exception-specification is non-throwing if it isof the form throw(), noexcept, or noexcept(constant-expression ) where thea dynamic-exception-specification whose set of adjusted types is empty (after any packs are expanded) or a noexcept-specification whose constant-expression is either absent or yields true. A function with a non-throwing exception-specification does not allow any exceptions.
According to 13.7.4 [temp.variadic] paragraph 6, describing an empty pack expansion,
When N is zero, the instantiation of the expansion produces an empty list. Such an instantiation does not alter the syntactic interpretation of the enclosing construct, even in cases where omitting the list entirely would otherwise be ill-formed or would result in an ambiguity in the grammar.
This leaves open the question of whether something like
template<typename...T> void f() throw(T...);
should be considered to have a non-throwing exception-specification when T... is empty. The definition in 14.5 [except.spec] paragraph 12 appears to be syntactic regarding dynamic-exception-specifications:
An exception-specification is non-throwing if it is of the form throw(), noexcept, or noexcept(constant-expression ) where the constant-expression yields true. A function with a non-throwing exception-specification does not allow any exceptions.
It seems evident, however, that a dynamic-exception-specification with an empty pack expansion “does not allow any exceptions.”
History | |||
---|---|---|---|
Date | User | Action | Args |
2017-02-06 00:00:00 | admin | set | status: drwp -> cd4 |
2015-05-25 00:00:00 | admin | set | status: dr -> drwp |
2015-04-13 00:00:00 | admin | set | messages: + msg5426 |
2014-11-24 00:00:00 | admin | set | status: ready -> dr |
2014-03-03 00:00:00 | admin | set | messages: + msg4859 |
2014-03-03 00:00:00 | admin | set | status: open -> ready |
2013-09-24 00:00:00 | admin | create |