Title
bad_function_call::what() unhelpful
Status
c++17
Section
[func.wrap.badcall]
Submitter
Jonathan Wakely

Created on 2013-01-05.00:00:00 last changed 89 months ago

Messages

Date: 2014-03-29.18:51:10

Proposed resolution:

This wording is relative to N3936.

  1. Edit [func.wrap.badcall.const]:

    bad_function_call() noexcept;
    

    -1- Effects: constructs a bad_function_call object.

    -?- Postconditions: what() returns an implementation-defined NTBS.

Date: 2014-03-28.00:00:00

[ 2014-03-28 Library reflector vote ]

The issue has been identified as Tentatively Ready based on five votes in favour.

Date: 2014-03-15.00:00:00

[ 2014-03-27, STL provides improved wording ]

The new wording reflects better the general agreement of the committee, see also issue 2376 for similar wording.

Date: 2014-02-15.00:00:00

[ 2014-02-15 Issauqah ]

STL: I think it should be an implementation-defined NTBS, same on bad_weak_ptr. I will write a PR.

Date: 2013-03-15.00:00:00

[ 2013-03-15 Issues Teleconference ]

Moved to Open.

Consensus that we want consistency in how this is treated. Less consensus on what the common direction should be.

Alisdair to provide wording proposing that all string literals held by standard exception objects are either unspecified, or implmentation defined.

Date: 2013-01-05.00:00:00

A strict reading of the standard implies std::bad_function_call{}.what() returns the same string as std::exception{}.what() which doesn't help to know what happened if you catch an exception by reference to std::exception.

For consistency with bad_weak_ptr::what() it should return "bad_function_call".

See c++std-lib-33515 for other details.

There was a considerable support on the reflector to instead change the specification of both bad_weak_ptr::what() and bad_function_call::what() to return an implementation-defined string instead.

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2014-11-08 19:44:42adminsetstatus: voting -> wp
2014-11-04 10:26:50adminsetstatus: ready -> voting
2014-03-29 18:51:10adminsetmessages: + msg6931
2014-03-29 18:51:10adminsetstatus: open -> ready
2014-03-27 21:17:19adminsetmessages: + msg6929
2014-03-03 13:52:20adminsetmessages: + msg6893
2013-03-18 14:33:00adminsetmessages: + msg6441
2013-03-18 13:02:36adminsetstatus: new -> open
2013-01-11 23:26:24adminsetmessages: + msg6318
2013-01-05 00:00:00admincreate