This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 113d. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.

2024-04-05


967. Exception specification of replacement allocation function

Section: 6.7.5.5  [basic.stc.dynamic]     Status: NAD     Submitter: Steve Clamage     Date: 15 September, 2009

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).)

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.