[LLVMbugs] [Bug 10895] throw() with -fno-exceptions generates worse code than throw(std::bad_alloc)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Oct 17 10:21:00 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=10895

Douglas Gregor <dgregor at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID

--- Comment #1 from Douglas Gregor <dgregor at apple.com> 2011-10-17 12:20:59 CDT ---
This is C++ [expr.new]p13, which specifically states:

  If the allocation function returns null, initialization shall not be done,
the deallocation function shall not be called, and the value of the
new-expression shall be null.

In other words, the standard requires that we check for NULL when operator new
is not permitted to indicate failure by throwing an exception.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list