This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of C++17 status.
Section: 17.9.7 [except.nested] Status: C++17 Submitter: Stephan T. Lavavej Opened: 2015-03-27 Last modified: 2018-05-20
View all other issues in [except.nested].
View all issues with C++17 status.
When N2559 was voted into the Working Paper, it said "This function template must take special case to handle non-class types, unions and [[final]] classes that cannot be derived from, and [...]". However, its Standardese didn't handle final classes, and this was never revisited. Now that we have is_final, we can achieve this proposal's original intention.Additionally, we need to handle the case where U is nested_exception itself. is_base_of's wording handles this and ignores cv-qualifiers. (Note that is_class detects "non-union class type".)
STL, MC and JW already do this
MC: move to Ready, bring to motion on Friday
7 in favor, none opposed
This wording is relative to N4296.
Change 17.9.7 [except.nested] as depicted:
template <class T> [[noreturn]] void throw_with_nested(T&& t);
-6- Let U be remove_reference_t<T>.-7- Requires: U shall be CopyConstructible. -8- Throws: if
U is a non-union class type not derived from nested_exception, an exception of unspecified type that is publicly derived from both U and nested_exception and constructed from std::forward<T>(t), otherwise std::forward<T>(t).