[llvm-bugs] [Bug 42564] calls to operator delete(..., const std::nothrow_t &) are optimized out

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 10 18:26:53 PDT 2019


https://bugs.llvm.org/show_bug.cgi?id=42564

Richard Smith <richard-llvm at metafoo.co.uk> changed:

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

--- Comment #1 from Richard Smith <richard-llvm at metafoo.co.uk> ---
This is a permitted optimization. Under C++ [expr.new]p12
(http://eel.is/c++draft/expr.new#12):

"An implementation is allowed to omit a call to a replaceable global allocation
function ([new.delete.single], [new.delete.array]). When it does so, the
storage is instead provided by the implementation or provided by extending the
allocation of another new-expression."

In this case, the implementation provides storage for the 'new (std::nothrow)
A' expression itself rather than calling the allocation function, so it would
not be appropriate to call a deallocation function.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190711/d059a0cc/attachment.html>


More information about the llvm-bugs mailing list