Title
Exception specification of replacement allocation function
Status
nad
Section
6.7.5.5 [basic.stc.dynamic]
Submitter
Steve Clamage

Created on 2009-09-15.00:00:00 last changed 114 months ago

Messages

Date: 2014-11-15.00:00:00

Rationale (November, 2014):

The predeclared allocation functions no longer have an exception-specification, so formally this issue is no longer applicable. As noted in the rationale of issue 1948, however, the intent is that the predeclarations are no different from ordinary declarations, so the replacement functions must have compatible exception-specifications.

Date: 2022-11-20.07:54:16

The global allocation functions are implicitly declared in every translation unit with exception-specifications (6.7.5.5 [basic.stc.dynamic] paragraph 2). It is not clear what should happen if a replacement allocation function is declared without an exception-specification. Is that a conflict with the implicitly-declared function (as it would be with explicitly-declared functions, and presumably is if the <new> header is included)? Or does the new declaration replace the implicit one, including the lack of an exception-specification? Or does the implicit declaration prevail? (Regardless of the exception-specification or lack thereof, it is presumably undefined behavior for an allocation function to exit with an exception that cannot be caught by a handler of type std::bad_alloc (6.7.5.5.2 [basic.stc.dynamic.allocation] paragraph 3).)

History
Date User Action Args
2014-11-24 00:00:00adminsetmessages: + msg5266
2014-11-24 00:00:00adminsetstatus: open -> nad
2009-09-15 00:00:00admincreate