Title
throw_with_nested should not use perfect forwarding
Status
c++11
Section
[except.nested]
Submitter
INCITS

Created on 2010-08-25.00:00:00 last changed 161 months ago

Messages

Date: 2010-11-24.14:01:03

Proposed resolution:

Change 18.8.7 nested_exception [except.nested] as indicated:

[[noreturn]] template <class T> void throw_with_nested(T&& t);

Let U be remove_reference<T>::type

6 Requires: T U shall be CopyConstructible.

7 Throws: If T U is a non-union class type not derived from nested_exception, an exception of unspecified type that is publicly derived from both T U and nested_exception and constructed from std::forward<T>(t), otherwise throws std::forward<T>(t).

Date: 2010-11-24.14:01:03

[ Adopted at 2010-11 Batavia ]

Date: 2010-11-10.00:00:00

[ 2010-11-10 Batavia: LWG accepts Howard's updated wording with corrected boo boos reported by Sebastian Gesemann and Pete Becker, which is approved for Immediate adoption this meeting. ]

Date: 2010-10-24.00:00:00

[ 2010-10-24 Daniel adds: ]

Accepting n3144 would solve this issue.

Date: 2010-10-25.01:00:51

[ Resolution proposed by ballot comment ]

Patch [except.nested] p6-7 to match the intent with regards to requirements on T and the use of std::forward<T>(t).

Date: 2010-10-25.01:00:51

Addresses US-84

The throw_with_nested specification passes in its argument as T&& (perfect forwarding pattern), but then discusses requirements on T without taking into account that T may be an lvalue-reference type. It is also not clear in the spec that t is intended to be perfectly forwarded.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-11-24 14:01:03adminsetmessages: + msg5429
2010-11-14 13:10:57adminsetstatus: voting -> wp
2010-11-13 01:17:02adminsetstatus: open -> voting
2010-11-13 01:11:40adminsetstatus: immediate -> open
2010-11-10 14:00:56adminsetmessages: + msg5324
2010-11-10 14:00:56adminsetstatus: open -> immediate
2010-10-25 01:00:51adminsetmessages: + msg5109
2010-10-25 01:00:51adminsetmessages: + msg5108
2010-10-24 22:33:31adminsetmessages: + msg5074
2010-10-24 03:04:13adminsetmessages: + msg4899
2010-08-25 00:00:00admincreate