Movatterモバイル変換


[0]ホーム

URL:


Issue 1503 - WG21 CWG Issues
Title
Exceptions during copy to exception object
Status
cd3
Section
14.2 [except.throw]
Submitter
Daniel Krügler

Created on2012-05-11.00:00:00 last changed145 months ago

Messages

msg4433 (view)
Date: 2013-04-15.00:00:00

[Moved to DR at the April, 2013 meeting.]

msg3886 (view)
Date: 2012-08-15.00:00:00

Proposed resolution (August, 2012):

Change 14.2 [except.throw] paragraph 7 as follows:

If the exception handling mechanism, after completingevaluationof the expression to be thrownthe initialization of theexception object but before theexception is caughtactivation of a handler for the exception, calls a functionthat exits via an exception,std::terminate is called(14.6.2 [except.terminate]). [Example:

  struct C {    C() { }    C(const C&) {throw 0; }      if (std::uncaught_exception()) {        throw 0;    // throw during copy to handler's exception-declaration object (14.4 [except.handle])      }    }  };  int main() {    try {      throw C();   // callsstd::terminate() if construction of the handler's                   // exception-declaration object is not elided (11.4.5.3 [class.copy.ctor])    } catch(C) { }  }

end example]

msg3885 (view)
Date: 2012-05-11.00:00:00

According to 14.2 [except.throw] paragraph 7,

If the exception handling mechanism, after completing evaluation ofthe expression to be thrown but before the exception is caught, callsa function that exits via an exception,std::terminate iscalled (14.6.2 [except.terminate]).

This wording was overlooked in the resolution forissue 475 and should be changed, along with thefollowing example, to indicate thatstd::terminate will becalled for an uncaught exception only after initialization of theexception object is complete.

History
DateUserActionArgs
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2013-10-14 00:00:00adminsetstatus: dr -> drwp
2013-05-03 00:00:00adminsetmessages: +msg4433
2013-05-03 00:00:00adminsetstatus: ready -> dr
2012-11-03 00:00:00adminsetstatus: tentatively ready -> ready
2012-09-24 00:00:00adminsetmessages: +msg3886
2012-05-11 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp