Title
Behaviour of standard exception types
Status
c++17
Section
[bad.alloc] [new.badlength] [bad.cast] [bad.typeid] [bad.exception]
Submitter
Andy Sawyer

Created on 2014-03-31.00:00:00 last changed 89 months ago

Messages

Date: 2015-03-22.18:51:42

Proposed resolution:

This wording is relative to N4296.

  1. Edit [bad.alloc] p3 as indicated:

    bad_alloc() noexcept;
    

    […]

    -3- Remarks: The result of calling what() on the newly constructed object is implementation-defined.

  2. Edit [bad.alloc] p5 as indicated:

    virtual const char* what() const noexcept;
    

    -5- Returns: An implementation-defined NTBS.

    -?- Remarks: The message may be a null-terminated multibyte string (17.5.2.1.4.2), suitable for conversion and display as a wstring (21.3, 22.4.1.4).

  3. Edit class bad_array_new_length synopsis [new.badlength] as indicated:

    namespace std {
      class bad_array_new_length : public bad_alloc {
      public:
        bad_array_new_length() noexcept;
        virtual const char* what() const noexcept;
      };
    }
    
  4. Edit [new.badlength] as indicated:

    bad_array_new_length() noexcept;
    

    […]

    -3- Remarks: The result of calling what() on the newly constructed object is implementation-defined.

    virtual const char* what() const noexcept;
    

    -?- Returns: An implementation-defined NTBS.

    -?- Remarks: The message may be a null-terminated multibyte string (17.5.2.1.4.2), suitable for conversion and display as a wstring (21.3, 22.4.1.4).

  5. Edit [bad.cast] p3 as indicated:

    bad_cast() noexcept;
    

    […]

    -3- Remarks: The result of calling what() on the newly constructed object is implementation-defined..

  6. Edit [bad.typeid] p3 as indicated:

    bad_typeid() noexcept;
    

    […]

    -3- Remarks: The result of calling what() on the newly constructed object is implementation-defined..

  7. Edit [bad.exception] p3 as indicated:

    bad_exception() noexcept;
    

    […]

    -3- Remarks: The result of calling what() on the newly constructed object is implementation-defined..

Date: 2015-03-22.18:51:42

[ 2015-02, Cologne ]

NJ: I don't know why we need the explict statement about what() here, since bad_array_new_length already derives.
AM: yes.
NJ: Then "what()" is missing from the synopsis.
AM: Yes, that's an error and it needs to be added.

Conclusion: Update the wording to add the missing entry in the synopsis.

AM: The issue needs another update; we need to add missing "Remarks". DK updates the paper.
AM: Any objections to "tentatively ready"? No objections.

Date: 2014-06-15.00:00:00

[ 2014-06-17, Rapperswil ]

Jonathan provides alternative wording.

Date: 2014-06-28.16:58:31

I think we have an issue with the specification of some of the standard exception types. In particular, several of them have default constructors with remarks to the effect that "The result of calling what() on the newly constructed object is implementation-defined". (In some cases this is contradictory to a further specification of what(), which is specified to return an implementation-defined NTBS.)

Previous resolution from Andy [SUPERSEDED]:

This wording is relative to N3936.

  1. Edit [bad.alloc] p3 as indicated:

    bad_alloc() noexcept;
    

    […]

    -3- Remarks: The result of calling what() on the newly constructed object is implementation-definedwhat() returns an implementation-defined NTBS.

  2. Edit [new.badlength] p3 as indicated: [Drafting note: Added the Postcondition, since we don't say anything else about bad_array_new_length::what()end of note]

    bad_array_new_length() noexcept;
    

    […]

    -3- RemarksPostcondition: The result of calling what() on the newly constructed object is implementation-definedwhat() returns an implementation-defined NTBS.

  3. Edit [bad.cast] p3 as indicated:

    bad_cast() noexcept;
    

    […]

    -3- Remarks: The result of calling what() on the newly constructed object is implementation-defined..

  4. Edit [bad.typeid] p3 as indicated:

    bad_typeid() noexcept;
    

    […]

    -3- Remarks: The result of calling what() on the newly constructed object is implementation-defined..

  5. Edit [bad.exception] p3 as indicated:

    bad_exception() noexcept;
    

    […]

    -3- Remarks: The result of calling what() on the newly constructed object is implementation-defined..

History
Date User Action Args
2017-07-30 20:15:43adminsetstatus: wp -> c++17
2015-05-22 18:31:21adminsetstatus: ready -> wp
2015-03-22 18:51:42adminsetmessages: + msg7244
2015-03-22 18:51:42adminsetstatus: review -> ready
2014-06-28 16:58:31adminsetmessages: + msg7073
2014-06-28 16:58:31adminsetstatus: new -> review
2014-03-31 19:39:38adminsetmessages: + msg6935
2014-03-31 00:00:00admincreate