[llvm-bugs] [Bug 38300] Wrong exception deduction for some forms of placement new

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jul 25 07:56:09 PDT 2018


David Blaikie <dblaikie at gmail.com> changed:

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

--- Comment #2 from David Blaikie <dblaikie at gmail.com> ---
ah, nope - read 7.6 more carefully:

"If the expression is erroneous after converting to std::size_t:
(7.5) — if the expression is a core constant expression, the program is
(7.6) — otherwise, an allocation function is not called; instead
(7.6.1) — if the allocation function that would have been called has a
non-throwing exception specification
(18.4), the value of the new-expression is the null pointer value of the
required result
(7.6.2) — otherwise, the new-expression terminates by throwing an exception of
a type that would match a
handler (18.3) of type std::bad_array_new_length ("

Yep, my best reading of that is that 7.6.1 applies in all these cases and a
null pointer should be returned instead of throwing std::bad_array_new_length.

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/20180725/1f9a15db/attachment.html>

More information about the llvm-bugs mailing list