CWG Issue 521 (original) (raw)
This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117a. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-04-13
521. Requirements for exceptions thrown by allocation functions
Section: 6.7.6.5.2 [basic.stc.dynamic.allocation]Status: CD1Submitter: Alisdair MeredithDate: 22 May 2005
[Voted into WP at the October, 2006 meeting.]
According to 6.7.6.5.2 [basic.stc.dynamic.allocation] paragraph 3,
Any other allocation function that fails to allocate storage shall only indicate failure by throwing an exception of class std::bad_alloc (17.6.4.1 [bad.alloc]) or a class derived from std::bad_alloc.
Shouldn't this statement have the usual requirements for an unambiguous and accessible base class?
Proposed resolution (April, 2006):
Change the last sentence of 6.7.6.5.2 [basic.stc.dynamic.allocation] paragraph 3 as indicated:
Any other allocation function that fails to allocate storage shall
onlyindicate failure only by throwing an exception ofclass std::bad_alloc (17.6.4.1 [bad.alloc]) or a class derived from std::bad_alloca type that would match a handler (14.4 [except.handle]) of typestd::bad_alloc (17.6.4.1 [bad.alloc]).