[PATCH] Throw std::bad_array_new_length as expected

Aaron Ballman aaron at aaronballman.com
Wed Aug 27 14:26:29 PDT 2014


[expr.new]p7 states (in part):

... If the expression, after converting to std::size_t, is a core
constant expression and the expression is erroneous, the program is
ill-formed. Otherwise, a new-expression with an erroneous expression
does not call an allocation function and terminates by throwing an
exception of a type that would match a handler (15.3) of type
std::bad_array_new_length (18.6.2.2). ...

This patch implements support for throwing that exception, at least
with the Itanium ABI. It calls out that the Microsoft ABI does not
currently implement this functionality, but there's a test in place
which we can fix when we get around to better MS support for this.

~Aaron
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oper_new.patch
Type: application/octet-stream
Size: 7754 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140827/03ef1d3f/attachment.obj>


More information about the cfe-commits mailing list