Title
§[res.on.exception.handling]/3 should not be applied to all standard library types
Status
new
Section
[res.on.exception.handling]
Submitter
Jiang An

Created on 2023-01-07.00:00:00 last changed 22 months ago

Messages

Date: 2023-02-15.00:00:00

[ 2023-02-01; Reflector poll ]

Set priority to 3 after reflector poll. Unclear who the "shall" imposes requirements on. Maybe split into constraint on the library to not put noexcept(false) on destructors, and constraint on users that the library can assume destructors don't throw. Should also make it clear which parts of the subclause are normative and which are not.

Date: 2023-01-15.00:00:00

[ 2023-01-29; Daniel comments ]

This issue has very much overlap with LWG 3229.

Date: 2023-01-07.00:00:00

Some standard library types, such as std::pair, std::tuple, and std::array, are currently allowed to have a member or element type with a destructor that is noexcept(false). In order to conform to [res.on.exception.handling]/3, these types can't always have implicitly declared destructors because the implicit exception specification may be noexcept(false).

However, it may be intentional to implement these types with implicitly declared destructors, and mainstream implementations (libc++, libstdc++, and MSVC STL) are already doing so.

Furtherly, explicitly declared destructors are not allowed for algorithm result types ([algorithms.results]), while currently these class templates are allowed to be instantiated with classes with potentially throwing destructors, which is contradictory to [res.on.exception.handling]/3.

History
Date User Action Args
2023-02-01 20:48:23adminsetmessages: + msg13251
2023-01-29 11:23:47adminsetmessages: + msg13228
2023-01-07 00:00:00admincreate